SHA256
1
0
forked from pool/s390-tools

Accepting request 563489 from home:markkp:branches:Base:System

- Converted the following SysV init scripts to systemd unit files
  and scripts (bsc#1050786):
  * appldata
  * hsnc
  * vmlogrdr
  * xpram

OBS-URL: https://build.opensuse.org/request/show/563489
OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=43
This commit is contained in:
Mark Post
2018-01-11 00:30:11 +00:00
committed by Git OBS Bridge
parent b12140c3aa
commit f675d71be2
10 changed files with 111 additions and 358 deletions

85
hsnc
View File

@@ -12,24 +12,8 @@
# /usr/sbin/start_hsnc.sh
# /use/sbin/rchsnc
#
#
# System startup script for the HiperSockets Network Concentrator
#
### BEGIN INIT INFO
# Provides: hsnc
# Required-Start: $network $remote_fs
# Required-Stop: $null
# Default-Start: 3 5
# Default-Stop: 0 1 6
# Short-Description: HiperSockets Network Concentrator
# Description: Start the qeth HiperSockets Network Concentrator
### END INIT INFO
#
#
#
#
#
#
# /etc/hsnc.conf should contain the following lines:
#
# operating_mode=[unicast|full|no]
@@ -57,20 +41,6 @@ test -x $START_HSNC_BIN || exit 5
test -x $IP_WATCHER_BIN || exit 5
test -x $XCEC_BRIDGE_BIN || exit 5
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
# rc_status check and set local and overall rc status
# rc_status -v ditto but be verbose in local rc status
# rc_status -v -r ditto and clear the local rc status
# rc_failed set local and overall rc status to failed
# rc_failed <num> set local and overall rc status to <num><num>
# rc_reset clear local rc status (overall remains)
# rc_exit exit appropriate to overall rc status
. /etc/rc.status
# First reset status of this service
rc_reset
# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
@@ -99,7 +69,7 @@ read_config_file() {
else
echo -ne "\nCannot read $file: empty or nonexistant! "
# Means not configured:
return 3
exit 3
fi
}
@@ -159,24 +129,17 @@ do_start_hsnc() {
service="HiperSockets Network concentrator"
case "$1" in
start)
if [ -e /sys/devices/qeth ]; then
echo -n "Starting $service "
else
echo -n "- cannot start $service, no /sys/devices/qeth "
rc_failed 1
fi
if checkproc $START_HSNC_BIN; then
# Starting an already running service is success:
echo -n "(already running)"
else
if read_config_file; then
do_start_hsnc
RETVAL=$?
exit $RETVAL
fi
fi
# Remember status and be verbose
rc_status -v
;;
stop)
echo -n "Shutting down $service "
@@ -184,7 +147,6 @@ case "$1" in
# kill ip_watcher, start_hsnc, which started it needs cleans up
# then:
killproc -TERM $IP_WATCHER_BIN
rc_failed $?
if [ -f $HSNC_CLEANUP_FILE ]; then
read_config_file cleanup
# remove all connector settings(not yet implemented):
@@ -197,43 +159,6 @@ case "$1" in
echo -n "- no cleanup file found "
fi
# Remember status and be verbose
rc_status -v
;;
try-restart)
## Stop the service and if this succeeds (i.e. the
## service was running before), start it again.
## Note: try-restart is not (yet) part of LSB (as of 0.7.5)
$0 status >/dev/null && $0 restart
# Remember status and be quiet
rc_status
;;
restart)
## Stop the service and regardless of whether it was
## running or not, start it again.
$0 stop
$0 start
# Remember status and be quiet
rc_status
;;
force-reload)
## start_hsnc.sh does not listen to signals
echo -n "Force-reload $service "
$0 stop && $0 start
rc_status
;;
reload)
## start_hsnc.sh does not listen to signals
echo -n "Reload $service: not supported"
## it does not support reload:
rc_failed 3
rc_status -v
;;
status)
echo -n "Checking $service "
@@ -248,11 +173,9 @@ case "$1" in
# NOTE: checkproc returns LSB compliant status values.
checkproc $START_HSNC_BIN
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart}"
exit 1
;;
esac
rc_exit