I am trying to execute the script with systemd and below is the service definition I am using but, the script is not running before the reboot occurs:
[Unit]
Description=Before Shutting Down
Before=reboot.target
RequiresMountsFor=/home
[Service]
Type=oneshot
User=oracle
ExecStart=/home/oracle/scripts/stop_db.sh
RemainAfterExit=yes
[Install]
WantedBy=reboot.target
Any luck please? Went through multiple solutions suggested without any luck.
Service status:
● dbstop.service - Before Shutting Down
Loaded: loaded (/etc/systemd/system/dbstop.service; enabled; vendor preset: disabled)
Active: inactive (dead)