Providing normal users(non-root) with initialization and shutdown auto-run capabilities
I agree that your solution seems a bit complex, so I'll go with "give me some idea how this could be implemented in an entirely different way" :-)
The standard solution for this is to use a configuration management system, such as puppet, and allow users to add their stuff to the puppet config for the server. Puppet will then push out the start script and add them to the relevant runlevels.
A quicker way would be to give them sudoedit access to
/etc/rc.d/rc.local
and add their things there.Or give them each a directory to put the start scripts they want started, and have a cron job copy those scripts to
/etc/init.d
, insertingsu $USER -c
at suitable places and run chkconfig on them.Or give them each a directory to put the start scripts, and add some lines at the end fo
/etc/rc.d/rc.local
to go through those directories and run editedsu $USER -c 'script start'
on each script in them.
Edited to add:
5. Let them use crontab to schedule the jobs to be run @reboot