beating systemctl into submission, script to enhance SERVICE
Posted: 2014/08/21 00:17:54
I am still not warming up to systemd or systemctl so I wrote a script to enhance the service command on CentOS 7
Would appreciate feedback and improvements since my bash-fu is not that great.
https://gist.github.com/ck-on/b7d5849787c8cdf398b5
Basically you save it to /usr/local/bin/service and chmod +x /usr/local/bin/service
and then run hash -d service once (to make centos stop using native service command first)
Then you get these little bonuses:
1. status runs automatically after commands instead of an empty response to see if it really started/stopped
2. journalctl log is shown so after a start you can actually see messages from the daemon/process (which systemctl hides)
3. ansi color is selectively added to special keywords
4. you can add back custom commands like service nginx configtest (I also have mysql configtest in there)
5. shortcuts like service reload instead of trying to remember systemctl daemon-reload
I know it is not for everyone but give me a few years to get comfortable with systemd and systemctl
I am working on a chkconfig replacement inside of it that does easier to read output for both init.d and systemd services
Would appreciate feedback and improvements since my bash-fu is not that great.
https://gist.github.com/ck-on/b7d5849787c8cdf398b5
Basically you save it to /usr/local/bin/service and chmod +x /usr/local/bin/service
and then run hash -d service once (to make centos stop using native service command first)
Then you get these little bonuses:
1. status runs automatically after commands instead of an empty response to see if it really started/stopped
2. journalctl log is shown so after a start you can actually see messages from the daemon/process (which systemctl hides)
3. ansi color is selectively added to special keywords
4. you can add back custom commands like service nginx configtest (I also have mysql configtest in there)
5. shortcuts like service reload instead of trying to remember systemctl daemon-reload
I know it is not for everyone but give me a few years to get comfortable with systemd and systemctl
I am working on a chkconfig replacement inside of it that does easier to read output for both init.d and systemd services