anarcat / bup-cron

mirror of the bup-cron repository, may be out of date while i figure out github mirror things
https://gitlab.com/anarcat/bup-cron
GNU Affero General Public License v3.0
22 stars 4 forks source link

Fix lockfile handling #15

Closed blueyed closed 9 years ago

blueyed commented 9 years ago

I've ran bup-cron with sudo and then tried to run it as a normal user, too:

configured stdout level 10
bup-cron 1.3 starting
locking pidfile /mnt/backup/localhost.bup-cron/.bup-cron.pid
can't deliver signal to 30333
removed staled lockfile /mnt/backup/localhost.bup-cron/.bup-cron.pid
...

Additionally, init and clear were not covered/protected by the pidfile.

anarcat commented 9 years ago

good calls, in general. i was worried you found critical bugs in the pidfile code, i was a little embarrassed to have reinvented the wheel there. glad it sustained one review. :)

i wonder if there shouldn't be a PEP or library about daemon thingies in Python... oh wait:

https://www.python.org/dev/peps/pep-3143/ https://pypi.python.org/pypi/python-daemon/

...sigh. maybe one problem is it itself depends on another non-standard lib:

https://pypi.python.org/pypi/lockfile

... which I seem to have inadvertedly reimplemented. double-sigh.