Accepting request 563490 from Base:System
OBS-URL: https://build.opensuse.org/request/show/563490 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/s390-tools?expand=0&rev=16
This commit is contained in:
commit
c324b42414
63
appldata
63
appldata
@ -2,51 +2,11 @@
|
|||||||
# Copyright (c) 2003 SUSE LINUX AG Nuernberg, Germany.
|
# Copyright (c) 2003 SUSE LINUX AG Nuernberg, Germany.
|
||||||
#
|
#
|
||||||
# Submit feedback to http://www.suse.de/feedback/
|
# Submit feedback to http://www.suse.de/feedback/
|
||||||
#
|
|
||||||
# /etc/init.d/appldata
|
|
||||||
#
|
|
||||||
# and symbolic its link
|
|
||||||
#
|
|
||||||
# /use/sbin/rcappldata
|
|
||||||
#
|
|
||||||
# System startup script for "Linux - z/VM Monitor Stream".
|
|
||||||
#
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: appldata
|
|
||||||
# Required-Start: $network $remote_fs
|
|
||||||
# Required-Stop: $null
|
|
||||||
# Default-Start: 3 5
|
|
||||||
# Default-Stop: 0 1 6
|
|
||||||
# Short-Description: Linux - z/VM Monitor Stream
|
|
||||||
# Description: Start the Linux - z/VM Monitor Stream
|
|
||||||
### END INIT INFO
|
|
||||||
#
|
|
||||||
|
|
||||||
# Local settings
|
# Local settings
|
||||||
LOCKFILE=/var/lock/appldata
|
LOCKFILE=/var/lock/appldata
|
||||||
CONFIGFILE=/etc/sysconfig/appldata
|
CONFIGFILE=/etc/sysconfig/appldata
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
# APPLDATA support in kernel?
|
|
||||||
if [ ! -e /proc/sys/appldata/interval ]; then
|
|
||||||
echo "No kernel support for \"Linux - z/VM Monitor Stream\"!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Source config file
|
# Source config file
|
||||||
if [ -f $CONFIGFILE ]; then
|
if [ -f $CONFIGFILE ]; then
|
||||||
. $CONFIGFILE
|
. $CONFIGFILE
|
||||||
@ -59,11 +19,6 @@ RETVAL=0
|
|||||||
|
|
||||||
start() {
|
start() {
|
||||||
echo "Starting \"Linux - z/VM Monitor Stream\" ..."
|
echo "Starting \"Linux - z/VM Monitor Stream\" ..."
|
||||||
if [ -e $LOCKFILE ]; then
|
|
||||||
echo -n "(already running)"
|
|
||||||
rc_status -v
|
|
||||||
rc_exit
|
|
||||||
fi
|
|
||||||
echo -n "(interval $APPLDATA_INTERVAL milliseconds) "
|
echo -n "(interval $APPLDATA_INTERVAL milliseconds) "
|
||||||
echo $APPLDATA_INTERVAL > /proc/sys/appldata/interval
|
echo $APPLDATA_INTERVAL > /proc/sys/appldata/interval
|
||||||
if [ "$APPLDATA_MEM" = "yes" ]; then
|
if [ "$APPLDATA_MEM" = "yes" ]; then
|
||||||
@ -71,7 +26,7 @@ start() {
|
|||||||
echo -n "(mem) "
|
echo -n "(mem) "
|
||||||
modprobe appldata_mem 2>&1
|
modprobe appldata_mem 2>&1
|
||||||
if [ "$?" -ne 0 ] ; then
|
if [ "$?" -ne 0 ] ; then
|
||||||
rc_failed 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo 1 > /proc/sys/appldata/mem
|
echo 1 > /proc/sys/appldata/mem
|
||||||
fi
|
fi
|
||||||
@ -82,7 +37,7 @@ start() {
|
|||||||
echo -n "(os) "
|
echo -n "(os) "
|
||||||
modprobe appldata_os 2>&1
|
modprobe appldata_os 2>&1
|
||||||
if [ "$?" -ne 0 ]; then
|
if [ "$?" -ne 0 ]; then
|
||||||
rc_failed 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo 1 > /proc/sys/appldata/os
|
echo 1 > /proc/sys/appldata/os
|
||||||
fi
|
fi
|
||||||
@ -93,7 +48,7 @@ start() {
|
|||||||
echo -n "(net_sum) "
|
echo -n "(net_sum) "
|
||||||
modprobe appldata_net_sum 2>&1
|
modprobe appldata_net_sum 2>&1
|
||||||
if [ "$?" -ne 0 ]; then
|
if [ "$?" -ne 0 ]; then
|
||||||
rc_failed 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo 1 > /proc/sys/appldata/net_sum
|
echo 1 > /proc/sys/appldata/net_sum
|
||||||
fi
|
fi
|
||||||
@ -102,7 +57,6 @@ start() {
|
|||||||
echo -n "(timer)"
|
echo -n "(timer)"
|
||||||
echo 1 > /proc/sys/appldata/timer
|
echo 1 > /proc/sys/appldata/timer
|
||||||
touch $LOCKFILE
|
touch $LOCKFILE
|
||||||
rc_status -v
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
@ -126,12 +80,6 @@ stop() {
|
|||||||
fi
|
fi
|
||||||
echo -n ")"
|
echo -n ")"
|
||||||
rm -f $LOCKFILE
|
rm -f $LOCKFILE
|
||||||
rc_status -v
|
|
||||||
}
|
|
||||||
|
|
||||||
restart() {
|
|
||||||
stop
|
|
||||||
start
|
|
||||||
}
|
}
|
||||||
|
|
||||||
status() {
|
status() {
|
||||||
@ -171,13 +119,8 @@ case "$1" in
|
|||||||
status)
|
status)
|
||||||
status
|
status
|
||||||
;;
|
;;
|
||||||
restart|reload)
|
|
||||||
restart
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "Usage: appldata {start|stop|status|restart|reload}"
|
|
||||||
RETVAL=1
|
RETVAL=1
|
||||||
esac
|
esac
|
||||||
|
|
||||||
exit $RETVAL
|
exit $RETVAL
|
||||||
|
|
||||||
|
17
appldata.service
Normal file
17
appldata.service
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Linux - z/VM Monitor Stream
|
||||||
|
After=network-online.target remote-fs.target
|
||||||
|
Wants=network-online.target remote-fs.target
|
||||||
|
ConditionPathExists=/proc/sys/appldata/interval
|
||||||
|
ConditionPathExists=!/var/lock/appldata
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
|
|
||||||
|
ExecStart=/usr/lib/systemd/scripts/appldata start
|
||||||
|
ExecStartPost=/usr/lib/systemd/scripts/appldata status
|
||||||
|
ExecStop=/usr/lib/systemd/scripts/appldata stop
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
85
hsnc
85
hsnc
@ -12,24 +12,8 @@
|
|||||||
# /usr/sbin/start_hsnc.sh
|
# /usr/sbin/start_hsnc.sh
|
||||||
# /use/sbin/rchsnc
|
# /use/sbin/rchsnc
|
||||||
#
|
#
|
||||||
#
|
|
||||||
# System startup script for the HiperSockets Network Concentrator
|
# 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:
|
# /etc/hsnc.conf should contain the following lines:
|
||||||
#
|
#
|
||||||
# operating_mode=[unicast|full|no]
|
# 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 $IP_WATCHER_BIN || exit 5
|
||||||
test -x $XCEC_BRIDGE_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:
|
# Return values acc. to LSB for all commands but status:
|
||||||
# 0 - success
|
# 0 - success
|
||||||
# 1 - generic or unspecified error
|
# 1 - generic or unspecified error
|
||||||
@ -99,7 +69,7 @@ read_config_file() {
|
|||||||
else
|
else
|
||||||
echo -ne "\nCannot read $file: empty or nonexistant! "
|
echo -ne "\nCannot read $file: empty or nonexistant! "
|
||||||
# Means not configured:
|
# Means not configured:
|
||||||
return 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -159,24 +129,17 @@ do_start_hsnc() {
|
|||||||
service="HiperSockets Network concentrator"
|
service="HiperSockets Network concentrator"
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
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
|
if checkproc $START_HSNC_BIN; then
|
||||||
# Starting an already running service is success:
|
# Starting an already running service is success:
|
||||||
echo -n "(already running)"
|
echo -n "(already running)"
|
||||||
else
|
else
|
||||||
if read_config_file; then
|
if read_config_file; then
|
||||||
do_start_hsnc
|
do_start_hsnc
|
||||||
|
RETVAL=$?
|
||||||
|
exit $RETVAL
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remember status and be verbose
|
|
||||||
rc_status -v
|
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
echo -n "Shutting down $service "
|
echo -n "Shutting down $service "
|
||||||
@ -184,7 +147,6 @@ case "$1" in
|
|||||||
# kill ip_watcher, start_hsnc, which started it needs cleans up
|
# kill ip_watcher, start_hsnc, which started it needs cleans up
|
||||||
# then:
|
# then:
|
||||||
killproc -TERM $IP_WATCHER_BIN
|
killproc -TERM $IP_WATCHER_BIN
|
||||||
rc_failed $?
|
|
||||||
if [ -f $HSNC_CLEANUP_FILE ]; then
|
if [ -f $HSNC_CLEANUP_FILE ]; then
|
||||||
read_config_file cleanup
|
read_config_file cleanup
|
||||||
# remove all connector settings(not yet implemented):
|
# remove all connector settings(not yet implemented):
|
||||||
@ -197,43 +159,6 @@ case "$1" in
|
|||||||
echo -n "- no cleanup file found "
|
echo -n "- no cleanup file found "
|
||||||
fi
|
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)
|
status)
|
||||||
echo -n "Checking $service "
|
echo -n "Checking $service "
|
||||||
@ -248,11 +173,9 @@ case "$1" in
|
|||||||
|
|
||||||
# NOTE: checkproc returns LSB compliant status values.
|
# NOTE: checkproc returns LSB compliant status values.
|
||||||
checkproc $START_HSNC_BIN
|
checkproc $START_HSNC_BIN
|
||||||
rc_status -v
|
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Usage: $0 {start|stop|status|try-restart|restart}"
|
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
rc_exit
|
|
||||||
|
16
hsnc.service
Normal file
16
hsnc.service
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Start the qeth HiperSockets Network Concentrator
|
||||||
|
After=network-online.target remote-fs.target
|
||||||
|
Wants=network-online.target remote-fs.target
|
||||||
|
ConditionPathExists=/sys/devices/qeth
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
|
|
||||||
|
ExecStart=/usr/lib/systemd/scripts/hsnc start
|
||||||
|
ExecStartPost=/usr/lib/systemd/scripts/hsnc status
|
||||||
|
ExecStop=/usr/lib/systemd/scripts/hsnc stop
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
@ -1,3 +1,13 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Dec 12 01:01:09 UTC 2017 - mpost@suse.com
|
||||||
|
|
||||||
|
- Converted the following SysV init scripts to systemd unit files
|
||||||
|
and scripts (bsc#1050786):
|
||||||
|
* appldata
|
||||||
|
* hsnc
|
||||||
|
* vmlogrdr
|
||||||
|
* xpram
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Dec 7 23:08:31 UTC 2017 - mpost@suse.com
|
Thu Dec 7 23:08:31 UTC 2017 - mpost@suse.com
|
||||||
|
|
||||||
|
@ -60,7 +60,6 @@ Source5: xpram
|
|||||||
Source6: sysconfig.xpram
|
Source6: sysconfig.xpram
|
||||||
Source7: appldata
|
Source7: appldata
|
||||||
Source8: sysconfig.appldata
|
Source8: sysconfig.appldata
|
||||||
Source9: vmlogrdr
|
|
||||||
Source10: dasdro
|
Source10: dasdro
|
||||||
Source11: dasd_reload
|
Source11: dasd_reload
|
||||||
Source12: mkdump.pl
|
Source12: mkdump.pl
|
||||||
@ -86,6 +85,10 @@ Source33: lgr_check
|
|||||||
Source34: sysconfig.virtsetup
|
Source34: sysconfig.virtsetup
|
||||||
Source35: virtsetup.service
|
Source35: virtsetup.service
|
||||||
Source36: virtsetup.sh
|
Source36: virtsetup.sh
|
||||||
|
Source37: appldata.service
|
||||||
|
Source38: hsnc.service
|
||||||
|
Source39: vmlogrdr.service
|
||||||
|
Source40: xpram.service
|
||||||
|
|
||||||
### Obsolete scripts and man pages to be removed once changes in other tools are made
|
### Obsolete scripts and man pages to be removed once changes in other tools are made
|
||||||
### That's been delayed to at least SLES12 SP1, but I'm leaving the comments here.
|
### That's been delayed to at least SLES12 SP1, but I'm leaving the comments here.
|
||||||
@ -268,19 +271,22 @@ install -D -m755 %{S:27} %{buildroot}/usr/lib/systemd/scripts/setup_cio_ignore.s
|
|||||||
install -D -m755 %{S:31} %{buildroot}/usr/lib/systemd/scripts/detach_disks.sh
|
install -D -m755 %{S:31} %{buildroot}/usr/lib/systemd/scripts/detach_disks.sh
|
||||||
install -D -m644 %{S:35} %{buildroot}/%{_unitdir}/virtsetup.service
|
install -D -m644 %{S:35} %{buildroot}/%{_unitdir}/virtsetup.service
|
||||||
install -D -m755 %{S:36} %{buildroot}/usr/lib/systemd/scripts/virtsetup.sh
|
install -D -m755 %{S:36} %{buildroot}/usr/lib/systemd/scripts/virtsetup.sh
|
||||||
|
install -D -m644 %{S:37} %{buildroot}/%{_unitdir}/appldata.service
|
||||||
|
install -D -m644 %{S:38} %{buildroot}/%{_unitdir}/hsnc.service
|
||||||
|
install -D -m644 %{S:39} %{buildroot}/%{_unitdir}/vmlogrdr.service
|
||||||
|
install -D -m644 %{S:40} %{buildroot}/%{_unitdir}/xpram.service
|
||||||
|
|
||||||
cp %{S:18} zpxe.rexx
|
cp %{S:18} zpxe.rexx
|
||||||
cp %{S:2} zipl.conf.sample
|
cp %{S:2} zipl.conf.sample
|
||||||
cp %{S:23} README.SUSE
|
cp %{S:23} README.SUSE
|
||||||
|
|
||||||
cd %{buildroot}
|
cd %{buildroot}
|
||||||
install -D -m755 %{S:3} etc/init.d/hsnc
|
install -D -m755 %{S:3} %{buildroot}/usr/lib/systemd/scripts/hsnc
|
||||||
install -D -m644 %{S:4} %{buildroot}%{_fillupdir}/sysconfig.hsnc
|
install -D -m644 %{S:4} %{buildroot}%{_fillupdir}/sysconfig.hsnc
|
||||||
install -D -m755 %{S:5} etc/init.d/xpram
|
install -D -m755 %{S:5} %{buildroot}/usr/lib/systemd/scripts/xpram
|
||||||
install -D -m644 %{S:6} %{buildroot}%{_fillupdir}/sysconfig.xpram
|
install -D -m644 %{S:6} %{buildroot}%{_fillupdir}/sysconfig.xpram
|
||||||
install -D -m755 %{S:7} etc/init.d/appldata
|
install -D -m755 %{S:7} %{buildroot}/usr/lib/systemd/scripts/appldata
|
||||||
install -D -m644 %{S:8} %{buildroot}%{_fillupdir}/sysconfig.appldata
|
install -D -m644 %{S:8} %{buildroot}%{_fillupdir}/sysconfig.appldata
|
||||||
install -D -m755 %{S:9} etc/init.d/vmlogrdr
|
|
||||||
install -D -m755 %{S:10} sbin/dasdro
|
install -D -m755 %{S:10} sbin/dasdro
|
||||||
install -D -m755 %{S:11} sbin/dasd_reload
|
install -D -m755 %{S:11} sbin/dasd_reload
|
||||||
install -D -m755 %{S:12} sbin/mkdump
|
install -D -m755 %{S:12} sbin/mkdump
|
||||||
@ -301,10 +307,10 @@ if [ ! -d %{_sbindir} ]; then
|
|||||||
rm -f %{_sbindir}
|
rm -f %{_sbindir}
|
||||||
mkdir -p %{_sbindir}
|
mkdir -p %{_sbindir}
|
||||||
fi
|
fi
|
||||||
(cd usr/sbin; ln -s ../../etc/init.d/appldata rcappldata)
|
(cd usr/sbin; ln -s service rcappldata)
|
||||||
(cd usr/sbin; ln -s ../../etc/init.d/hsnc rchsnc)
|
(cd usr/sbin; ln -s service rchsnc)
|
||||||
(cd usr/sbin; ln -s ../../etc/init.d/vmlogrdr rcvmlogrdr)
|
(cd usr/sbin; ln -s service rcvmlogrdr)
|
||||||
(cd usr/sbin; ln -s ../../etc/init.d/xpram rcxpram)
|
(cd usr/sbin; ln -s service rcxpram)
|
||||||
(cd usr/sbin; ln -s service rccio_ignore)
|
(cd usr/sbin; ln -s service rccio_ignore)
|
||||||
(cd usr/sbin; ln -s service rccpacfstatsd)
|
(cd usr/sbin; ln -s service rccpacfstatsd)
|
||||||
(cd usr/sbin; ln -s service rccpi)
|
(cd usr/sbin; ln -s service rccpi)
|
||||||
|
98
vmlogrdr
98
vmlogrdr
@ -1,98 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Copyright (c) 2003 SUSE LINUX AG Nuernberg, Germany.
|
|
||||||
#
|
|
||||||
# Submit feedback to http://www.suse.de/feedback/
|
|
||||||
#
|
|
||||||
# /etc/init.d/vmlogrdr
|
|
||||||
#
|
|
||||||
# and symbolic its link
|
|
||||||
#
|
|
||||||
# /use/sbin/rcvmlogrdr
|
|
||||||
#
|
|
||||||
#
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: vmlogrdr
|
|
||||||
# Required-Start: $network $remote_fs
|
|
||||||
# Required-Stop: $null
|
|
||||||
# Default-Start: 3 5
|
|
||||||
# Default-Stop: 0 1 6
|
|
||||||
# Short-Description: Linux - z/VM Log reader
|
|
||||||
# Description: System startup script for the Linux - z/VM Log reader
|
|
||||||
### END INIT INFO
|
|
||||||
#
|
|
||||||
|
|
||||||
# Local settings
|
|
||||||
SERVICE=LOGREC
|
|
||||||
DEVNODE=/dev/vmlogrdr_${SERVICE}
|
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
|
|
||||||
RETVAL=0
|
|
||||||
|
|
||||||
start() {
|
|
||||||
echo -n "Starting z/VM log reader for service $SERVICE... "
|
|
||||||
if [ -e $DEVNODE ]; then
|
|
||||||
echo -n "(already running)"
|
|
||||||
rc_status -v
|
|
||||||
rc_exit
|
|
||||||
fi
|
|
||||||
modprobe vmlogrdr 2>&1
|
|
||||||
if [ "$?" -ne 0 ] ; then
|
|
||||||
rc_failed 1
|
|
||||||
fi
|
|
||||||
rc_status -v
|
|
||||||
}
|
|
||||||
|
|
||||||
stop() {
|
|
||||||
echo "Stopping z/VM log reader for service $SERVICE... "
|
|
||||||
rmmod vmlogrdr
|
|
||||||
rc_status -v
|
|
||||||
}
|
|
||||||
|
|
||||||
restart() {
|
|
||||||
stop
|
|
||||||
start
|
|
||||||
}
|
|
||||||
|
|
||||||
status() {
|
|
||||||
echo -n "Checking z/VM log reader for service $SERVICE... "
|
|
||||||
if [ ! -e $DEVNODE ]; then
|
|
||||||
rc_failed 1
|
|
||||||
fi
|
|
||||||
rc_status -v
|
|
||||||
}
|
|
||||||
|
|
||||||
# How are we called?
|
|
||||||
case "$1" in
|
|
||||||
start)
|
|
||||||
start
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
stop
|
|
||||||
;;
|
|
||||||
status)
|
|
||||||
status
|
|
||||||
;;
|
|
||||||
restart|reload)
|
|
||||||
restart
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: vmlogrdr {start|stop|status|restart|reload}"
|
|
||||||
RETVAL=1
|
|
||||||
esac
|
|
||||||
|
|
||||||
exit $RETVAL
|
|
||||||
|
|
15
vmlogrdr.service
Normal file
15
vmlogrdr.service
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=System startup script for the Linux - z/VM Log reader
|
||||||
|
After=network-online.target remote-fs.target
|
||||||
|
Wants=network-online.target remote-fs.target
|
||||||
|
ConditionPathExists=!/dev/vmlogrdr_LOGREC
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
|
|
||||||
|
ExecStart=/sbin/modprobe vmlogrdr
|
||||||
|
ExecStop=/sbin/modprobe -r vmlogrdr
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
123
xpram
123
xpram
@ -3,24 +3,7 @@
|
|||||||
#
|
#
|
||||||
# Submit feedback to http://www.suse.de/feedback/
|
# Submit feedback to http://www.suse.de/feedback/
|
||||||
#
|
#
|
||||||
# /etc/init.d/xpram
|
|
||||||
#
|
|
||||||
# and symbolic its link
|
|
||||||
#
|
|
||||||
# /use/sbin/rcxpram
|
|
||||||
#
|
|
||||||
# System startup script for XPRAM device driver
|
# System startup script for XPRAM device driver
|
||||||
#
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: xpram
|
|
||||||
# Required-Start: $remote_fs
|
|
||||||
# Required-Stop: $null
|
|
||||||
# Default-Start: 3 5
|
|
||||||
# Default-Stop: 0 1 6
|
|
||||||
# Short-Description: XPRAM device driver
|
|
||||||
# Description: Creates an xpram device and mounts it
|
|
||||||
### END INIT INFO
|
|
||||||
#
|
|
||||||
|
|
||||||
XPRAM_CONFIG_FILE=/etc/sysconfig/xpram
|
XPRAM_CONFIG_FILE=/etc/sysconfig/xpram
|
||||||
|
|
||||||
@ -36,8 +19,6 @@ read_config_file() {
|
|||||||
else
|
else
|
||||||
echo -ne "Cannot read $file: empty or nonexistant! "
|
echo -ne "Cannot read $file: empty or nonexistant! "
|
||||||
# Means not configured:
|
# Means not configured:
|
||||||
rc_failed 6
|
|
||||||
rc_status -v
|
|
||||||
return 6
|
return 6
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@ -45,9 +26,7 @@ read_config_file() {
|
|||||||
prepare_xpram() {
|
prepare_xpram() {
|
||||||
if [ -z "$XPRAM_MNTPATH" -o -z "$XPRAM_DEVNODE" ]; then
|
if [ -z "$XPRAM_MNTPATH" -o -z "$XPRAM_DEVNODE" ]; then
|
||||||
echo -n "Cannot mkfs/mount XPRAM: Missing parameters! "
|
echo -n "Cannot mkfs/mount XPRAM: Missing parameters! "
|
||||||
rc_failed 6
|
exit 6
|
||||||
rc_status -v
|
|
||||||
rc_exit
|
|
||||||
fi
|
fi
|
||||||
grep -q $XPRAM_DEVNODE /proc/mounts 2>&1 > /dev/null
|
grep -q $XPRAM_DEVNODE /proc/mounts 2>&1 > /dev/null
|
||||||
if [ $? -eq 0 ] ; then
|
if [ $? -eq 0 ] ; then
|
||||||
@ -71,9 +50,7 @@ prepare_xpram() {
|
|||||||
then
|
then
|
||||||
echo
|
echo
|
||||||
echo -n "Warning: current filessystem and configured filesystem are not the same!"
|
echo -n "Warning: current filessystem and configured filesystem are not the same!"
|
||||||
rc_failed 6
|
exit 6
|
||||||
rc_status -v
|
|
||||||
rc_exit
|
|
||||||
fi
|
fi
|
||||||
if [ "$XPRAM_FSTYPE" = swap ]
|
if [ "$XPRAM_FSTYPE" = swap ]
|
||||||
then
|
then
|
||||||
@ -92,28 +69,11 @@ prepare_xpram() {
|
|||||||
if [ $? -ne 0 ]
|
if [ $? -ne 0 ]
|
||||||
then
|
then
|
||||||
echo -n "Mount failed with error code $?"
|
echo -n "Mount failed with error code $?"
|
||||||
rc_failed 6
|
exit 6
|
||||||
rc_status -v
|
|
||||||
rc_exit
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# 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
|
|
||||||
config_read=0
|
|
||||||
rc_reset
|
|
||||||
|
|
||||||
# Return values acc. to LSB for all commands but status:
|
# Return values acc. to LSB for all commands but status:
|
||||||
# 0 - success
|
# 0 - success
|
||||||
# 1 - generic or unspecified error
|
# 1 - generic or unspecified error
|
||||||
@ -132,9 +92,7 @@ rc_reset
|
|||||||
check_config () {
|
check_config () {
|
||||||
if [ -z "$XPRAM_MODULE" ]; then
|
if [ -z "$XPRAM_MODULE" ]; then
|
||||||
echo -n "$file: parameters XPRAM_MODULE missing! "
|
echo -n "$file: parameters XPRAM_MODULE missing! "
|
||||||
rc_failed 6
|
exit 6
|
||||||
rc_status -v
|
|
||||||
rc_exit
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,20 +100,8 @@ quit_disabled() {
|
|||||||
if [ "$XPRAM_START" != "yes" ]; then
|
if [ "$XPRAM_START" != "yes" ]; then
|
||||||
# Config file exists but xpram not enabled, do not complain,
|
# Config file exists but xpram not enabled, do not complain,
|
||||||
# but note with exit status 6 that we are not configured.
|
# but note with exit status 6 that we are not configured.
|
||||||
rc_exit
|
echo "xpram not enabled"
|
||||||
fi
|
exit 0
|
||||||
}
|
|
||||||
|
|
||||||
check_enabled() {
|
|
||||||
if [ "$XPRAM_START" != "yes" ]; then
|
|
||||||
rc_failed 6
|
|
||||||
if [ "$XPRAM_MODULE" ]; then
|
|
||||||
if grep -q "$XPRAM_MODULE" /proc/modules; then
|
|
||||||
echo -n "Service $service $_rc_todo "
|
|
||||||
rc_status -v
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
rc_exit
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,9 +109,8 @@ service="xpram"
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
# Read in configuration
|
# Read in configuration
|
||||||
read_config_file || rc_exit
|
read_config_file || exit 6
|
||||||
|
|
||||||
check_enabled
|
|
||||||
quit_disabled
|
quit_disabled
|
||||||
check_config
|
check_config
|
||||||
|
|
||||||
@ -173,17 +118,15 @@ case "$1" in
|
|||||||
modprobe "$XPRAM_MODULE"
|
modprobe "$XPRAM_MODULE"
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo -n "- failed to load $XPRAM_MODULE "
|
echo -n "- failed to load $XPRAM_MODULE "
|
||||||
rc_failed 1
|
exit 1
|
||||||
else
|
else
|
||||||
prepare_xpram
|
prepare_xpram
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remember status and be verbose
|
|
||||||
rc_status -v
|
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
# Read in configuration
|
# Read in configuration
|
||||||
read_config_file || rc_exit
|
read_config_file || exit 6
|
||||||
|
|
||||||
# check_enabled
|
# check_enabled
|
||||||
# quit_disabled
|
# quit_disabled
|
||||||
@ -203,44 +146,10 @@ case "$1" in
|
|||||||
|
|
||||||
if grep -q "$XPRAM_MODULE" /proc/modules; then
|
if grep -q "$XPRAM_MODULE" /proc/modules; then
|
||||||
rmmod "$XPRAM_MODULE"
|
rmmod "$XPRAM_MODULE"
|
||||||
rc_status
|
|
||||||
else
|
else
|
||||||
rc_failed 7
|
exit 7
|
||||||
fi
|
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)
|
|
||||||
echo -n "Force-reload $service "
|
|
||||||
|
|
||||||
$0 stop && $0 start
|
|
||||||
rc_status
|
|
||||||
;;
|
|
||||||
reload)
|
|
||||||
echo -n "Reloading $service not supported."
|
|
||||||
|
|
||||||
## it does not support reload:
|
|
||||||
rc_failed 3
|
|
||||||
rc_status -v
|
|
||||||
;;
|
;;
|
||||||
status)
|
status)
|
||||||
echo -n "Checking $service "
|
echo -n "Checking $service "
|
||||||
@ -251,7 +160,7 @@ case "$1" in
|
|||||||
# 3 - service not running
|
# 3 - service not running
|
||||||
|
|
||||||
# Read in configuration
|
# Read in configuration
|
||||||
read_config_file || rc_exit
|
read_config_file || exit 3
|
||||||
|
|
||||||
check_config
|
check_config
|
||||||
|
|
||||||
@ -261,18 +170,12 @@ case "$1" in
|
|||||||
if ! grep -q $XPRAM_DEVNODE /proc/mounts && ! swapon -s | grep -q $XPRAM_DEVNODE; then
|
if ! grep -q $XPRAM_DEVNODE /proc/mounts && ! swapon -s | grep -q $XPRAM_DEVNODE; then
|
||||||
xpram_result=3
|
xpram_result=3
|
||||||
echo -n "loaded, but $XPRAM_DEVNODE not used"
|
echo -n "loaded, but $XPRAM_DEVNODE not used"
|
||||||
rc_failed 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
rc_failed 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rc_status -v
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: $0 {start|stop|status|try-restart|restart}"
|
|
||||||
exit 1
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
rc_exit
|
|
||||||
|
18
xpram.service
Normal file
18
xpram.service
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Linux - z/VM Monitor Stream
|
||||||
|
After=network-online.target remote-fs.target
|
||||||
|
Wants=network-online.target remote-fs.target
|
||||||
|
ConditionPathExists=/proc/sys/appldata/interval
|
||||||
|
ConditionPathExists=!/var/lock/appldata
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
|
SuccessExitStatus=3
|
||||||
|
|
||||||
|
ExecStart=/usr/lib/systemd/scripts/xpram start
|
||||||
|
ExecStartPost=/usr/lib/systemd/scripts/xpram status
|
||||||
|
ExecStop=/usr/lib/systemd/scripts/xpram stop
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
Loading…
Reference in New Issue
Block a user