You are not logged in.

#1 2020-06-15 08:04:02

aarjun07
Member
Registered: 2020-06-14
Posts: 1

systemd custom services to run before user.slice killed at reboot

Hi Team,

I have two services which are dependent on each other and are working fine at boot up but at shutdown / reboot , the processes get killed as shutdown got initated.

Services are running fine in particular order but processes got killed .I have enabled lingering on both users and changed confgiuration in logind.conf to KillUserProcesses=no but still issue is same

##############
Systemd service files content are below

cat /etc/systemd/system/grid.service
[Unit]
Description=Service to auto start Oracle ASM application
Before=rdbms.service
After=syslog.target network.target nfs-mountd.service autofs.service systemd-user-sessions.service system.slice
[Service]
Type=simple
TimeoutSec=5min
User=grid
Group=dba
ExecStart=/opt/admin/bin/asm
ExecStop=/opt/admin/bin/asm_stop
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target



cat /etc/systemd/system/rdbms.service
[Unit]
Description=Service to auto start Oracle RDBMS application
Requires=grid.service
After=grid.service syslog.target network.target nfs-mountd.service autofs.service systemd-user-sessions.service system.slice
[Service]
Type=simple
TimeoutSec=5min
User=osarahn9
Group=dba
ExecStart=/opt/admin/bin/rdbms
ExecStop=/opt/admin/bin/rdbms_stop
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target grid.service


let me know if my configuration is faulty or what I have missed so that shutdown should be graceful for services and processes will be shutdown with systemd custom service?

I want first rdbms.service should be called and get process stopped before grid.services (it seems systemd are killing user.slices processes) and in startup-inverse should be followed .
Please help .

Offline

Board footer

Powered by FluxBB