The after.local.service fails to start with exec format error
This document (7017128) is provided subject to the disclaimer at the end of this document.
Environment
SUSE Linux Enterprise Server 12 Service Pack 1 (SLES 12 SP1)
Situation
ls-boot:~ # systemctl status after.localA restart of the service results in the following error:
after.local.service
Loaded: loaded (/etc/init.d/after.local)
Active: failed (Result: exit-code) since Wed 2016-01-06 01:06:07 MST; 7h ago
Process: 638 ExecStart=/etc/init.d/after.local start (code=exited, status=203/EXEC)
Jan 06 01:06:07 ls-boot systemd[1]: Failed to start after.local.service.
ls-boot:~ # systemctl restart after.localIf you run journalctl and search for after.local, you see the following error:
Job for after.local.service failed. See "systemctl status after.local.service" and "journalctl -xn" for details.
ls-boot systemd[675]: Failed at step EXEC spawning /etc/init.d/after.local: Exec format errorThe content of /etc/init.d/after.local is:
ls-boot:~ # cat /etc/init.d/after.local
touch /var/log/test.log
Resolution
Change /etc/init.d/after.local from this:
ls-boot:~ # cat /etc/init.d/after.localto this:
touch /var/log/test.log
ls-boot:~ # cat /etc/init.d/after.localReboot the server or restart the systemd processes as follows:
#!/bin/bash
touch /var/log/test.log
ls-boot:~ # systemctl daemon-reload
ls-boot:~ # systemctl restart after.local
ls-boot:~ # systemctl status after.local
after.local.service
Loaded: loaded (/etc/init.d/after.local)
Active: active (exited) since Wed 2016-01-06 09:32:19 MST; 11s ago
Process: 2594 ExecStart=/etc/init.d/after.local start (code=exited, status=0/SUCCESS)
ls-boot:~ # ls -l /var/log/test.log
-rw-r--r-- 1 root root 0 Jan 6 09:32 /var/log/test.log
Cause
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:7017128
- Creation Date: 06-Jan-2016
- Modified Date:03-Mar-2020
-
- SUSE Linux Enterprise Server
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com