[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Bug] Systemd Shutdown



Hello,

Before I start, I really like Debian 8.

I'm not an expert in Linux, but I think I found an issue.
I'm using Debian 8.7 and running in root.
I wanted to use systemd to copy meta-data file from ramdisk before I shutdown.
Here's the steps that I did:
1) created a file called test.sh, which is a script stored in /usr/local/bin/:

#!/bin/sh
cp -r /home/david/test/tt.log /home/david/test1/tt.log

2) created a file test.service and stored in /etc/systemd/system/
In test.service,
[Unit]
Description=The Shutdown

[Service]
Type=oneshot
ReaminAfterExit=true
ExecStart=/bin/true
ExecStop=/usr/local/bin/test.service.sh

[Install]
WantedBy=multi-user.target 

3) I run systemctl daemon-reload and systemctl enable test.service.

4) When I checked "systemctl status test.service", it states active.

However, when I reboot or shutdown, it doesn't work.
There is no file found in /home/david/test1/

Please advise.
Thanks,

David

Reply to: