diff options
author | Ade Lee <alee@redhat.com> | 2014-01-03 12:46:36 -0500 |
---|---|---|
committer | Ade Lee <alee@redhat.com> | 2014-01-08 17:35:06 -0500 |
commit | 26f73fc5bb226c1d2f0a3d6f686c21c5d0cb24e3 (patch) | |
tree | 3370c1112fe792625af918f248b861e136096152 /base/server/scripts/pkidaemon | |
parent | cc831a6be57a868cd36d15335eb0f65e77779c55 (diff) | |
download | pki-26f73fc5bb226c1d2f0a3d6f686c21c5d0cb24e3.tar.gz pki-26f73fc5bb226c1d2f0a3d6f686c21c5d0cb24e3.tar.xz pki-26f73fc5bb226c1d2f0a3d6f686c21c5d0cb24e3.zip |
Debian: add init script functionality
The addtions in this patch will add start/stop/restart/status
functionality to operations, so that Debian systems can perform
these operations by calling these functions from an init script.
We also introduce a parameter in the configuration scripts that
can be used to determine if the system is a debian system. This
parameter is used to specify a system V init script instead of
a systemd script on a debian system, when the configuration
scriptlets start and stop a system.
Also source apparently does not work by default in debian. Used
dot (.) instead.
Diffstat (limited to 'base/server/scripts/pkidaemon')
-rwxr-xr-x | base/server/scripts/pkidaemon | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/base/server/scripts/pkidaemon b/base/server/scripts/pkidaemon index ce7d13ce1..e4bc2492f 100755 --- a/base/server/scripts/pkidaemon +++ b/base/server/scripts/pkidaemon @@ -34,6 +34,17 @@ PKI_SYSTEMD_TARGET="pki-${pki_instance_type}d" # Source the PKI function library . /usr/share/pki/scripts/operations +print_usage() +{ + echo + usage + echo "where valid instance types include:" + list_instance_types + echo "and where valid instance names include:" + list_instances + exit ${default_error} +} + # See how we were called. case $command in status) @@ -44,6 +55,22 @@ case $command in start exit $? ;; + stop) + if $debian; then + stop + else + echo "invalid action ($command)" + print_usage + fi + ;; + restart) + if $debian; then + restart + else + echo "invalid action ($command)" + print_usage + fi + ;; *) echo "unknown action ($command)" echo |