/usr/sbin/maas-region-celeryd is in maas-region-controller-min 1.5+bzr2252-0ubuntu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | #! /usr/bin/python
import os
from grp import getgrnam
from pwd import getpwnam
def start_celery(args):
uid = getpwnam(args.user).pw_uid
gid = getgrnam(args.group).gr_gid
env = dict(os.environ, PYTHONPATH="/usr/share/maas")
command = [
'celeryd',
'--logfile=%s' % args.logfile,
'--schedule=%s' % args.schedule,
'--loglevel=INFO',
'--beat',
'--queues=celery,master',
]
# Change gid first, just in case changing the uid might deprive
# us of the privileges required to setgid.
os.setgid(gid)
os.setuid(uid)
os.execvpe(command[0], command, env=env)
def main():
import argparse
parser = argparse.ArgumentParser(
description='MAAS celery daemon config options')
parser.add_argument(
'--user', '-u', metavar='USER', default='maas',
help="System user identity that should run the cluster controller.")
parser.add_argument(
'--group', '-g', metavar='GROUP', default='maas',
help="System group that should run the cluster controller.")
parser.add_argument(
'--logfile', '-l', metavar='LOGFILE', default='/var/log/maas/celery-region.log',
help="Location of the logfile.")
parser.add_argument(
'--schedule', '-s', metavar='SCHEDULE', default='/var/lib/maas/celerybeat-region-schedule',
help="Location of the beat schedule file.")
args = args = parser.parse_args()
start_celery(args)
if __name__ == '__main__':
main()
|