Reputation: 5523
I've made a script to register and un-register a server: python registerTool.py start and python registerTool.py stop
I want to run these tools on boot and on shutdown. but is there a tool that can make scripts for me for different distributions like Ubuntu, Debian, Archlinux etc..
Is there a tool that can do this for me?
Upvotes: 2
Views: 178
Reputation: 31453
Most Linux distributions support the SysV system for managing runlevel scripts.
You can use update-rc.d to register scripts for the different runlevels. (see man update-rc.d
on your systems for relevant docu).
For example: update-rc.d <your-script> defaults
This will make links to start the service in runlevels 2345 and to stop the service in runlevels 016 and will create the appropriate SysV-style scripts inside /etc/rc?.d/
I am not sure if this will work directly with python scripts, but you can always wrap them in one-line-bash scripts.
Upvotes: 1