[Bug 1841928] Re: systemd service file not triggering the bash script
Chris Guiver
guiverc at gmail.com
Thu Aug 29 11:52:42 UTC 2019
Thank you for taking the time to report this issue and helping to make
Ubuntu better.
Examining the information you have given us, this does not appear to be
a bug report, but instead seems to be a request for support. Is it?
We understand the difficulties you are facing, but it is better to raise
problems you are having in the support tracker at
https://answers.launchpad.net/ubuntu if you are uncertain if they are
bugs.
You can also find help with your problem in the support forum of your
local Ubuntu community http://loco.ubuntu.com/ or asking at
https://askubuntu.com or https://ubuntuforums.org. For help on reporting
bugs, see https://help.ubuntu.com/community/ReportingBugs.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1841928
Title:
systemd service file not triggering the bash script
Status in systemd package in Ubuntu:
New
Bug description:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.6 LTS"
systemd:
Installed: 229-4ubuntu21.21
Candidate: 229-4ubuntu21.22
Version table:
229-4ubuntu21.22 500
500 http://eu-central-1.ec2.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
*** 229-4ubuntu21.21 500
500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
100 /var/lib/dpkg/status
229-4ubuntu4 500
500 http://eu-central-1.ec2.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
Computer type: AWS EC2 instance
I am creating a systemd service file like this:
######################################################################
bootscript=/usr/bin/local/luksautomount.sh
servicename=luksautomount
cat > $bootscript <<EOF
#!/usr/bin/env bash
echo "$bootscript ran at $(date)!" >> /tmp/it-works
EOF
chmod +x $bootscript
cat > /etc/systemd/system/$servicename.service <<EOF
[Service]
ExecStart=$bootscript
[Install]
WantedBy=default.target
EOF
######################################################################
After successful creation of the service file and bash script that is
triggered with the service file, I am testing the service file with:
systemctl start $servicename
Syslog shows that service has been started, but the "/tmp/it-works" is
never created nor the line appended to an existing file.
######################################################################
Aug 29 11:11:02 ip-10-124-0-64 systemd[1]: Started customboot.service.
######################################################################
If I rename the service file to anything else that "luksautomount", the service is started, the bash script executed and the line is appended to the "/tmp/it-works" file.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1841928/+subscriptions
More information about the foundations-bugs
mailing list