Good morning,

We are trying to start a custom service on a Raspberry PIZero Wireless. The procedure we are using works on a PI3 under Ubuntu 14.04. The PiZero runs 2017-04-10-raspbian-jessie. I'll use the name CUSTOM_SERVICE below.

I tried different things without success. Querying the status of the service reports:

sudo systemctl status CUSTOM_SERVICE.service
‚óŹ CUSTOM_SERVICE.service - Custom service
   Loaded: loaded (/etc/systemd/system/CUSTOM_SERVICE.service; enabled)
   Active: activating (auto-restart) (Result: exit-code) since Wed 2017-04-26 14:44:40 UTC; 32s ago
  Process: 1516 ExecStart=/usr/local/etc/startCustomService (code=exited, status=203/EXEC)
 Main PID: 1516 (code=exited, status=203/EXEC)

Apr 26 14:44:40 raspberrypi systemd[1]: CUSTOM_SERVICE.service: main process exited, code=exited, status=203/EXEC
Apr 26 14:44:40 raspberrypi systemd[1]: Unit CUSTOM_SERVICE.service entered failed state.

Using the command:

sudo ls -l /etc/systemd/system/multi-user.target.wants/*.service


lrwxrwxrwx 1 root root 40 Apr 10 09:24 /etc/systemd/system/multi-user.target.wants/avahi-daemon.service -> /lib/systemd/system/avahi-daemon.service
lrwxrwxrwx 1 root root 38 Apr 26 13:53 /etc/systemd/system/multi-user.target.wants/CUSTOM_SERVICE.service -> /etc/systemd/system/CUSTOM_SERVICE.service

The service unit file is defined as:

more /etc/systemd/system/multi-user.target.wants/CUSTOM_SERVICE.service
Description=Custom service



where /usr/local/etc/startCustomService is defined as

more /usr/local/etc/startCustomService

As I said, the service is launched and running correctly under Ubuntu 14.04. Also note that the file /usr/local/etc/startCustomService can be launched manually on PIZero.

Any suggestions?

Regards, Daniel

  • Have you read Difference between systemd and terminal starting program and reviewed all the possible differences for a service to not run under systemd vs the shell? – Mark Stosberg Apr 26 '17 at 16:38
  • 2
    Your service exited with code 203. You should refer to the documentation for your service to determine the meaning of this exit code. – Mark Stosberg Apr 26 '17 at 16:39
  • Thanks for the feedback. Looking at /var/log/syslog, I saw the error Failed at step EXEC spawning /usr/local/etc/startCustomService: No such file or directory. The actual error was related to DOS type line termination in the different files, most importantly the startCustomService script. - Daniel – Daniel Labonté Apr 26 '17 at 19:39

Try add working directory.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.