Fix failing sm services on Debian
Modified sm to address the following failing services on Debian: sm.service sm-eru.service sm-watchdog.service sm-shutdown.service sm-api.service Applied fix: - Included modified .service files for debian directly into into the deb_folder. - Changed the script file to set the environmental variable LD_LIBRARY_PATH to the path of the libsm_db and libsm_common libs. - Included "override_dh_installsystemd" section to rules in order to install services. - Included postinst file to move the lib files and to start two services. Test Plan: PASS: Package installed and ISO built successfully. PASS: Services are on the expected state after iso install. PASS: Services are running after bootstrap on Debian. PASS: CentOS sm package is built and installed successfully Story: 2009101 Task: 44597 Signed-off-by: lbonatti <LuizEduardo.Bonatti@windriver.com> Change-Id: Iaa6e5087d6abe89b4fbfea464b2a19521faaa868
This commit is contained in:
parent
e7ed35ae4a
commit
8b2820f90f
|
@ -25,10 +25,12 @@ override_dh_install:
|
||||||
install -d $(ROOT)/usr/lib/systemd/system/
|
install -d $(ROOT)/usr/lib/systemd/system/
|
||||||
install -m 644 -p -D scripts/sm_api.ini $(ROOT)/etc/sm
|
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 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
|
install -m 644 -p -D scripts/sm-api.conf $(ROOT)/etc/pmon.d
|
||||||
|
|
||||||
dh_install
|
dh_install
|
||||||
|
|
||||||
override_dh_python3:
|
override_dh_python3:
|
||||||
dh_python3 --shebang=/usr/bin/python3
|
dh_python3 --shebang=/usr/bin/python3
|
||||||
|
|
||||||
|
override_dh_installsystemd:
|
||||||
|
dh_installsystemd --name sm-api
|
||||||
|
|
|
@ -3,5 +3,4 @@ usr/bin/sm-api
|
||||||
etc/init.d/sm-api
|
etc/init.d/sm-api
|
||||||
etc/pmon.d/sm-api.conf
|
etc/pmon.d/sm-api.conf
|
||||||
etc/sm/sm_api.ini
|
etc/sm/sm_api.ini
|
||||||
usr/lib/systemd/system/*
|
|
||||||
usr/lib/python*/dist-packages/*
|
usr/lib/python*/dist-packages/*
|
||||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -21,6 +21,9 @@ override_dh_auto_install:
|
||||||
VER_MJR=${VER_MJR} \
|
VER_MJR=${VER_MJR} \
|
||||||
install
|
install
|
||||||
|
|
||||||
|
override_dh_installsystemd:
|
||||||
|
dh_installsystemd --name sm-eru
|
||||||
|
|
||||||
# Prevents dh_fixperms from changing the permissions defined in the makefiles
|
# Prevents dh_fixperms from changing the permissions defined in the makefiles
|
||||||
override_dh_fixperms:
|
override_dh_fixperms:
|
||||||
dh_fixperms \
|
dh_fixperms \
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
etc/init.d/sm-watchdog
|
etc/init.d/sm-watchdog
|
||||||
etc/pmon.d/sm-watchdog.conf
|
etc/pmon.d/sm-watchdog.conf
|
||||||
usr/bin/sm-watchdog
|
usr/bin/sm-watchdog
|
||||||
usr/lib/systemd/system/sm-watchdog.service
|
|
||||||
|
|
|
@ -2,4 +2,3 @@ etc/init.d/sm-eru
|
||||||
etc/pmon.d/sm-eru.conf
|
etc/pmon.d/sm-eru.conf
|
||||||
usr/bin/sm-eru
|
usr/bin/sm-eru
|
||||||
usr/bin/sm-eru-dump
|
usr/bin/sm-eru-dump
|
||||||
usr/lib/systemd/system/sm-eru.service
|
|
||||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
/usr/bin/systemctl enable sm-shutdown.service >/dev/null 2>&1
|
||||||
|
|
||||||
|
#DEBHELPER#
|
||||||
|
exit 0
|
|
@ -9,6 +9,9 @@ override_dh_usrlocal:
|
||||||
# dh_usrlocal complains about files being put in /usr/local
|
# dh_usrlocal complains about files being put in /usr/local
|
||||||
# this empty override causes dh_usrlocal to be skipped.
|
# this empty override causes dh_usrlocal to be skipped.
|
||||||
|
|
||||||
|
override_dh_installsystemd:
|
||||||
|
dh_installsystemd --name sm
|
||||||
|
|
||||||
override_dh_auto_install:
|
override_dh_auto_install:
|
||||||
rm -rf ${ROOT}
|
rm -rf ${ROOT}
|
||||||
$(MAKE) DEST_DIR=${ROOT} \
|
$(MAKE) DEST_DIR=${ROOT} \
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
usr/lib/systemd/system/*
|
|
||||||
usr/bin/sm
|
usr/bin/sm
|
||||||
usr/local/sbin/sm-notify
|
usr/local/sbin/sm-notify
|
||||||
usr/local/sbin/sm-troubleshoot
|
usr/local/sbin/sm-troubleshoot
|
||||||
|
|
|
@ -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
|
|
@ -22,7 +22,7 @@
|
||||||
### END INIT INFO
|
### END INIT INFO
|
||||||
|
|
||||||
. /etc/init.d/functions
|
. /etc/init.d/functions
|
||||||
|
export LD_LIBRARY_PATH=/usr/lib/sm
|
||||||
RETVAL=0
|
RETVAL=0
|
||||||
|
|
||||||
SM_NAME="sm"
|
SM_NAME="sm"
|
||||||
|
|
Loading…
Reference in New Issue