I am now wishing to create a similar logging service for insertion into the shutdown procedure. Of course, the network still has to be connected, and I also realize that a crash, or power-off won't run my 'service'; that is OK. My interest is running my script during normal,software requested shutdowns.
My question then becomes about which 'After,WantedBy', etc. I need to accomplish this. My STARTUP service with it's script name:
Code: Select all
[Unit]
Description=MachineStartupLogging
After=network-online.target
[Service]
Type=simple
WorkingDirectory=/scripts
ExecStart=/bin/bash /scripts/machineStartStamp.sh
User=root
Group=root
[Install]
WantedBy=multi-user.target
Thank you.