I have two services like nano.service and micro.service which are copied in to /etc/systemd/system folders. Micro.service is depending on nano.service. Binaries of these files are stored in /usr/sbin folder.
When am running both simultaneously, i have no issues. But if i stop my nano.service forcefully by giving command
sudo systemctl stop nano.service and check status of both services then it says that
"sudo systemctl status nano.service"
Process : 19960 execStart=/usr/sbin/nano (core=killed, signal=TERM)
Main PID: 19960 (core=killed, signal=TERM)
"sudo systemctl status micro.service"
Active: failed (Result: core-dump)
Process : 19960 execStart=/usr/sbin/micro (core=dumped, signal=SEGV)
Main PID: 19960 (core=dumped, signal=SEGV)
Which means i stop first service forcefully then i receive segmentation fault in other service. But when i run binaries and i dont see any SEGV in second binary after killing first binary. Only in service i observe this issue. Also in my code i wrote error handling properly which handles both SIGTERM and SIGSEGV signals.
[Unit] Description=nano service After=rpcbind.service After=syslog.service After=network.target After=network-online.target Wants=dep.service After=dep.service Wants=dev-tpm0.device After=dev-tpm0.device [Service] User=system Type=simple ExecStart=/usr/sbin/nano Environment="LD_LIBRARY_PATH=/usr/local/lib/" Restart=always [Install] WantedBy=multi-user.target
[Unit] Description=micro service After=network-online.target Wants=network-online.target Requires=nano.service After=nano.service After=rpcbind.service [Service] User=system Type=simple Environment="CONFIG=/etc/mciro.config" "LD_LIBRARY_PATH=/usr/local/lib" EnvironmentFile=/etc/environment Restart=always ExecStart="/usr/sbin/micro" [Install] WantedBy=multi-user.target