Public bug reported:

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.

** Affects: systemd (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1841928

Title:
  systemd  service file not triggering the bash script

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1841928/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to