Mkrhinit creates a basic SysV Init script stub for Red Hat-based distributions. It's intended to help streamline the process of creating init scripts for services that didn't come packaged with their own.
TODO: marks places that necessarily require modification in order to turn the stub into a complete init script.
# ruby mkrhinit.rb [OPTIONS]
-p, --program PROGRAM Program name
-c, --config [FILE] Config file
-l, --levels [LEVELS] Runlevels
-h, --help Print help
# ruby mkrhinit.rb --program /usr/bin/appd --config /etc/sysconfig/appd -levels 2345 >> appd
# chmod -c +x appd
# cp -p appd /etc/init.d/
# chkconfig --add appd
The output is a basic version of an init script, which the user can then expand upon. However, this is not an LSB compliant stub. This script is designed as a training tool and should only be used in production after configuration and proper testing.
Where compatibility is concerned, most modern versions of any Red Hat-based distribution should suffice as long as SysV init scripts are still supported. RHEL 5 and 6 still use SysV but it is purported that RHEL 7 will use systemd.
While systemd still provides some compatibility for SysV init, I cannot guarantee that that scripts generated using this script will be supported. Use at your own risk.
Any of the Red Hat-based distributions. Major ones are listed here for reference:
| Red Hat Enterprise Linux |
| CentOS |
| Scientific Linux |
| Oracle Linux |
| Fedora |