Merge "Fix failing sm services on Debian"

This commit is contained in:
Zuul 2022-03-01 13:53:45 +00:00 committed by Gerrit Code Review
commit fcd6e9de94
16 changed files with 113 additions and 6 deletions

View File

@ -25,10 +25,12 @@ override_dh_install:
install -d $(ROOT)/usr/lib/systemd/system/
install -m 644 -p -D scripts/sm_api.ini $(ROOT)/etc/sm
install -m 755 -p -D scripts/sm-api $(ROOT)/etc/init.d
install -m 644 -p -D scripts/sm-api.service $(ROOT)/usr/lib/systemd/system/
install -m 644 -p -D scripts/sm-api.conf $(ROOT)/etc/pmon.d
dh_install
override_dh_python3:
dh_python3 --shebang=/usr/bin/python3
override_dh_installsystemd:
dh_installsystemd --name sm-api

View File

@ -3,5 +3,4 @@ usr/bin/sm-api
etc/init.d/sm-api
etc/pmon.d/sm-api.conf
etc/sm/sm_api.ini
usr/lib/systemd/system/*
usr/lib/python*/dist-packages/*

View File

@ -0,0 +1,15 @@
[Unit]
Description=Service Management API Unit
After=network-online.target syslog-ng.service config.service sm.service
Before=sm-eru.service pmon.service
[Service]
Type=forking
RemainAfterExit=yes
User=root
ExecStart=/etc/init.d/sm-api start
ExecStop=/etc/init.d/sm-api stop
PIDFile=/var/run/sm-api.pid
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,10 @@
#!/bin/sh
set -e
mkdir -p /usr/lib/sm
mv /usr/lib64/libsm_common.so* /usr/lib/sm
systemctl enable sm-watchdog
#DEBHELPER#
exit 0

View File

@ -21,6 +21,9 @@ override_dh_auto_install:
VER_MJR=${VER_MJR} \
install
override_dh_installsystemd:
dh_installsystemd --name sm-eru
# Prevents dh_fixperms from changing the permissions defined in the makefiles
override_dh_fixperms:
dh_fixperms \

View File

@ -1,4 +1,3 @@
etc/init.d/sm-watchdog
etc/pmon.d/sm-watchdog.conf
usr/bin/sm-watchdog
usr/lib/systemd/system/sm-watchdog.service

View File

@ -2,4 +2,3 @@ etc/init.d/sm-eru
etc/pmon.d/sm-eru.conf
usr/bin/sm-eru
usr/bin/sm-eru-dump
usr/lib/systemd/system/sm-eru.service

View File

@ -0,0 +1,15 @@
[Unit]
Description=Service Management Event Recorder Unit
After=network-online.target syslog-ng.service sm-api.service
Before=pmon.service
[Service]
Type=forking
RemainAfterExit=yes
User=root
ExecStart=/etc/init.d/sm-eru start
ExecStop=/etc/init.d/sm-eru stop
PIDFile=/var/run/sm-eru.pid
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,15 @@
[Unit]
Description=Service Management Watchdog
After=network-online.target syslog-ng.service config.service
Before=sm.service pmon.service
[Service]
Type=forking
RemainAfterExit=yes
User=root
ExecStart=/etc/init.d/sm-watchdog start
ExecStop=/etc/init.d/sm-watchdog stop
PIDFile=/var/run/sm-watchdog.pid
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,9 @@
#!/bin/sh
set -e
mkdir -p /usr/lib/sm
mv /usr/lib64/libsm_db.so* /usr/lib/sm
#DEBHELPER#
exit 0

View File

@ -0,0 +1,8 @@
#!/bin/sh
set -e
/usr/bin/systemctl enable sm-shutdown.service >/dev/null 2>&1
#DEBHELPER#
exit 0

View File

@ -9,6 +9,9 @@ override_dh_usrlocal:
# dh_usrlocal complains about files being put in /usr/local
# this empty override causes dh_usrlocal to be skipped.
override_dh_installsystemd:
dh_installsystemd --name sm
override_dh_auto_install:
rm -rf ${ROOT}
$(MAKE) DEST_DIR=${ROOT} \

View File

@ -0,0 +1,13 @@
[Unit]
Description=Service Management Shutdown Unit
After=sm.service
[Service]
Type=oneshot
User=root
ExecStop=/etc/init.d/sm-shutdown stop
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target

View File

@ -1,4 +1,3 @@
usr/lib/systemd/system/*
usr/bin/sm
usr/local/sbin/sm-notify
usr/local/sbin/sm-troubleshoot

View File

@ -0,0 +1,18 @@
[Unit]
Description=Service Management Unit
After=network-online.target syslog-ng.service config.service sm-watchdog.service systemd-udev-settle.service drbd.service
Before=sm-shutdown.service sm-api.service pmon.service
[Service]
Type=forking
RemainAfterExit=yes
User=root
ExecStart=/etc/init.d/sm start
ExecStop=/etc/init.d/sm stop
PIDFile=/var/run/sm.pid
KillMode=process
RestartSec=10
Restart=on-failure
[Install]
WantedBy=multi-user.target

View File

@ -22,7 +22,7 @@
### END INIT INFO
. /etc/init.d/functions
export LD_LIBRARY_PATH=/usr/lib/sm
RETVAL=0
SM_NAME="sm"