Gateway auto startup on linux

I have ignition 8.1 installed on ubuntu server. I’m having trouble getting it to auto start when the computer is booted up.

First I ran:
$ /usr/local/bin/ignition/ignition.sh install

then I ran:
$ systemctl enable Ignition-Gateway.service

next, I rebooted and ran:
$ systemctl status Ignition-Gateway.service
and get the following error


I’m not sure what is going wrong. Can anyone help me understand this?

Can you run the a sudo systemctl status Ignition-Gateway.service so we can see some of the logs? It looks like it is enabled and attempting to start, but failing for some reason.


I started it 15 minutes ago using the ignition.sh start command:
Screenshot from 2021-02-04 11-10-17

@kcollins1 I think the error is related to “status=217/USER”, but I’m not sure what that means. I’m trying to remember when I installed this, if I used the sudo command, or if I just installed it as the user I was logged in as… could this error be related to me installing it while logged in as a non-root user?

I’m not a systemd wizard unfortunately, but some initial research does seem to point to it being an issue with what user the gateway is targeted to run as by systemd. Perhaps the content of /etc/systemd/system/Ignition-Gateway.service might reveal some more info.

the Ignition-Gateway.service file is not in that directory! Could this be the problem? (I have no idea)

Also, a sudo systemctl status Ignition-Gateway.service after a reboot would likely be telling… Here is what I get when I adjust a test VM with a different User=xxxx line (to a user that doesn’t exist) in the service definition:

ubuntu@ubuntu-ignition-test:~$ systemctl status Ignition-Gateway.service
● Ignition-Gateway.service - Ignition-Gateway
     Loaded: loaded (/etc/systemd/system/Ignition-Gateway.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Fri 2021-02-05 12:15:44 CST; 19s ago
    Process: 613 ExecStart=/usr/local/bin/ignition/ignition.sh start sysd (code=exited, status=217/USER)

Feb 05 12:15:43 ubuntu-ignition-test systemd[1]: Starting Ignition-Gateway...
Feb 05 12:15:44 ubuntu-ignition-test systemd[613]: Ignition-Gateway.service: Failed to determine user credentials: No such process
Feb 05 12:15:44 ubuntu-ignition-test systemd[613]: Ignition-Gateway.service: Failed at step USER spawning /usr/local/bin/ignition/ignition.sh: No such process
Feb 05 12:15:44 ubuntu-ignition-test systemd[1]: Ignition-Gateway.service: Control process exited, code=exited, status=217/USER
Feb 05 12:15:44 ubuntu-ignition-test systemd[1]: Ignition-Gateway.service: Failed with result 'exit-code'.
Feb 05 12:15:44 ubuntu-ignition-test systemd[1]: Failed to start Ignition-Gateway.

If that file is not present, then I would imagine that the service is no longer installed. You can see the services that are installed with:

$ systemctl list-units --type=service

I think you have helped me zero in on it! This is right after a reboot:

brian@usp-clgateway:~$ sudo systemctl status Ignition-Gateway.service
● Ignition-Gateway.service - Ignition-Gateway
     Loaded: loaded (/etc/systemd/system/Ignition-Gateway.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Fri 2021-02-05 18:28:51 UTC; 2min 20s ago
    Process: 702 ExecStart=/usr/local/bin/ignition/ignition.sh start sysd (code=exited, status=217/USER)

Feb 05 18:28:51 usp-clgateway systemd[1]: Starting Ignition-Gateway...
Feb 05 18:28:51 usp-clgateway systemd[702]: Ignition-Gateway.service: Failed to determine user credentials: No such file or directory
Feb 05 18:28:51 usp-clgateway systemd[702]: Ignition-Gateway.service: Failed at step USER spawning /usr/local/bin/ignition/ignition.sh:>
Feb 05 18:28:51 usp-clgateway systemd[1]: Ignition-Gateway.service: Control process exited, code=exited, status=217/USER
Feb 05 18:28:51 usp-clgateway systemd[1]: Ignition-Gateway.service: Failed with result 'exit-code'.
Feb 05 18:28:51 usp-clgateway systemd[1]: Failed to start Ignition-Gateway.

So what is the best way to resolve? Reinstall ignition as the root user? Or pass a --USER=xxx somewhere?

I’d double check the existence of that service definition, if the service is loading, that file should be there. You can then try inspecting and then setting the User=... declaration. Here is the file from a fresh install on one of my VMs:

[Unit]
Description=Ignition-Gateway
After=syslog.target

[Service]
Type=forking
ExecStart=/usr/local/bin/ignition/ignition.sh start sysd
ExecStop=/usr/local/bin/ignition/ignition.sh stop sysd
User=ubuntu
KillMode=control-group
Environment=SYSTEMD_KILLMODE_WARNING=true

[Install]
WantedBy=multi-user.target

Make sure that:

  1. You verify the permissions of the install folder /usr/local/bin/ignition, you may need to chown -R <user>.root /usr/local/bin/ignition to make sure that the target user owns the gateway files.
  2. Run systemctl daemon-reload after you make changes to your service definition (not 100% sure if this is needed for every type of change, but it won’t hurt).
1 Like

Didn’t the default service name get changed back to just plain “ignition” in v8.1 for Linux?

On some Unix variants, the Tanuki wrapper does not recognize system.d and falls back to init.d! In this case there is no service definition but a symlink in init.d.

the service definition has the line:
User=ignition

but my /etc/passwd file does not have the user “ignition”

when I try to add the user:
$useradd ignition

I get "user ‘ignition’ already exists

I’m pretty confused! :slight_smile:

well, I ‘fixed’ it, but I’m not proud of how I did it.

1- created a new user ‘ignition2’ (I can’t remove the user ‘ignition’, and I can’t add it either!)
2- changed the ownership of all the files in the ignition directory to ignition2:root
3- edited the ignition.sh file, where the user ‘ignition’ was set, changed it to ‘ignition2’
4- ran ./ignition.sh install (after I ran with the remove option)
5- verified the /etc/systemd/system/Ignition-Gateway.service file was using “User=ignition2” (I might have manually edited this file in an earlier attempt, but I think it was created correctly after I edited the ignition.sh file)
6- ran sudo systemctl enable Ignition-Gateway.service

after a reboot, ignition is alive automatically