Skip to content

Commit

Permalink
try to avoid lauching @reboot jobs on creation
Browse files Browse the repository at this point in the history
  • Loading branch information
a-detiste committed Oct 29, 2014
1 parent 6c6128c commit 5da457f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/bin/crontab
Expand Up @@ -11,6 +11,8 @@ EDITOR = (os.environ.get('EDITOR') or
os.environ.get('VISUAL','/usr/bin/vim'))
CRONTAB_DIR = '@statedir@'

REBOOT_FILE = '/run/crond.reboot'

args_parser = argparse.ArgumentParser(description='maintain crontab files for individual users')

args_parser.add_argument('-u', '--user', type=str, dest='user', default=getpass.getuser(),
Expand Down Expand Up @@ -133,3 +135,8 @@ if __name__ == '__main__':
os.chown(cron_file, pwd.getpwnam(args.user).pw_uid)
except:
pass

try:
open(REBOOT_FILE,'a').close()
except:
pass

0 comments on commit 5da457f

Please sign in to comment.