diff options
author | Harald Musum <musum@yahoo-inc.com> | 2017-02-06 17:45:56 +0100 |
---|---|---|
committer | Harald Musum <musum@yahoo-inc.com> | 2017-02-06 17:45:56 +0100 |
commit | a4863f8a88ae4beb374ab9ab9c5f789a1d81cf4b (patch) | |
tree | 9b2c9c56490c1935eddfea2bfa622ce107d2dbc6 /node-admin | |
parent | 809b5c55869b0cb71d638d4ba996ba3fdee4cb91 (diff) |
Start and stop services
* Move start and stop to this script instead of doing it directly
in start-services.sh, the entry point for the Docker image we use.
* Leave out removing PID files, since we want to avoid removing those
when entry point still starts yinst and this script also does it.
Diffstat (limited to 'node-admin')
-rwxr-xr-x | node-admin/include/nodectl-instance.sh | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/node-admin/include/nodectl-instance.sh b/node-admin/include/nodectl-instance.sh index 9f762886a8c..d28c17fcebe 100755 --- a/node-admin/include/nodectl-instance.sh +++ b/node-admin/include/nodectl-instance.sh @@ -10,10 +10,10 @@ # # resume: Set the node "in service" by e.g. undraining container traffic # -# start: Start services on the node. Can be seen as a boot of a non-docker node. +# start: Start services on the node. Can be seen as a boot of a non-Docker node. # start can be assumed to have completed successfully. # -# stop: Stop services on the node, similar to shutdown of a non-docker node. +# stop: Stop services on the node. Can be seen as a shutdown of a non-Docker node. # # suspend: Prepare for a short suspension, e.g. there's a pending upgrade. Set the # node "out of service" by draining container traffic, and flush index for a @@ -102,14 +102,34 @@ Resume() { $echo $VESPA_HOME/bin/vespa-routing vip -u chef in } -# TODO: Remove vespa-routing when callers have been updated to use resume +# Start all services, can be seen as a reboot of a non-Docker node Start() { - # Always start vip for now - $echo $VESPA_HOME/bin/vespa-routing vip -u chef in + # Make sure there are no pid files left behind from last time container was running + # TODO: Enable after yinst start is no longer called in start-services.sh + #sudo rm -f /home/y/var/run/*pid + + echo "Configuring rsyslog service to work" + # Disable kernel log module + sed -i.bak 's/^\$ModLoad imklog/#$ModLoad imklog/' /etc/rsyslog.conf + echo "Starting rsyslog service" + service rsyslog start + + echo "Starting crond service" + service crond start + + echo "Starting all yinst packages" + yinst start + echo "yinst started, exited with $?" } +# Stop all services, can be seen as a shutdown of a non-Docker node Stop() { + echo "Stopping services and other yinst packages running" yinst stop + echo "Stopping crond service" + service crond stop + echo "Stopping rsyslog service" + service rsyslog stop } Suspend() { |