# Gateway auto startup on linux

**URL:** <https://forum.inductiveautomation.com/t/gateway-auto-startup-on-linux/43018>\
**Category:** Ignition\
**Created:** [February 4, 2021, 4:08pm UTC](https://forum.inductiveautomation.com/t/gateway-auto-startup-on-linux/43018 "2021-02-04T16:08:26Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![kb5won](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kb5won/32/4967_2.png) [@kb5won](https://forum.inductiveautomation.com/u/kb5won)\
**Post date:** [February 4, 2021, 4:08pm UTC](https://forum.inductiveautomation.com/t/gateway-auto-startup-on-linux/43018/1 "2021-02-04T16:08:26Z")

</div>

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

 ![Screenshot from 2021-02-04 10-04-31](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/3/73bef98a2c127ca68472189c807f8c3e53e2bcdb.png)  
I’m not sure what is going wrong. Can anyone help me understand this?

---

<div class="post-metadata">

**Author:** ![kcollins](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kcollins/32/19646_2.png) [@kcollins](https://forum.inductiveautomation.com/u/kcollins)\
**Post date:** [February 4, 2021, 5:00pm UTC](https://forum.inductiveautomation.com/t/gateway-auto-startup-on-linux/43018/2 "2021-02-04T17:00:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kb5won](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kb5won/32/4967_2.png) [@kb5won](https://forum.inductiveautomation.com/u/kb5won)\
**Post date:** [February 4, 2021, 5:10pm UTC](https://forum.inductiveautomation.com/t/gateway-auto-startup-on-linux/43018/3 "2021-02-04T17:10:52Z")

</div>

![Screenshot from 2021-02-04 11-09-15](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/c/9cbe19ac4e2478c33be4a9a77f3676c0e991c3b2.png)  
I started it 15 minutes ago using the ignition.sh start command:  
 ![Screenshot from 2021-02-04 11-10-17](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/0/00538d831788f2022e69f0d1a417f05742e84f6f.png)

---

<div class="post-metadata">

**Author:** ![kb5won](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kb5won/32/4967_2.png) [@kb5won](https://forum.inductiveautomation.com/u/kb5won)\
**Post date:** [February 5, 2021, 5:51pm UTC](https://forum.inductiveautomation.com/t/gateway-auto-startup-on-linux/43018/4 "2021-02-05T17:51:10Z")

</div>

@kcollins 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?

---

<div class="post-metadata">

**Author:** ![kcollins](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kcollins/32/19646_2.png) [@kcollins](https://forum.inductiveautomation.com/u/kcollins)\
**Post date:** [February 5, 2021, 6:09pm UTC](https://forum.inductiveautomation.com/t/gateway-auto-startup-on-linux/43018/5 "2021-02-05T18:09:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kb5won](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kb5won/32/4967_2.png) [@kb5won](https://forum.inductiveautomation.com/u/kb5won)\
**Post date:** [February 5, 2021, 6:17pm UTC](https://forum.inductiveautomation.com/t/gateway-auto-startup-on-linux/43018/6 "2021-02-05T18:17:05Z")

</div>

> [@kcollins](#):
>
> ...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)

---

<div class="post-metadata">

**Author:** ![kcollins](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kcollins/32/19646_2.png) [@kcollins](https://forum.inductiveautomation.com/u/kcollins)\
**Post date:** [February 5, 2021, 6:18pm UTC](https://forum.inductiveautomation.com/t/gateway-auto-startup-on-linux/43018/7 "2021-02-05T18:18:34Z")

</div>

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:

```auto
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.

```

---

<div class="post-metadata">

**Author:** ![kcollins](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kcollins/32/19646_2.png) [@kcollins](https://forum.inductiveautomation.com/u/kcollins)\
**Post date:** [February 5, 2021, 6:21pm UTC](https://forum.inductiveautomation.com/t/gateway-auto-startup-on-linux/43018/8 "2021-02-05T18:21:30Z")

</div>

> [@kb5won](#):
>
> the Ignition-Gateway.service file is not in that directory! Could this be the problem? (I have no idea)

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:

```auto
$ systemctl list-units --type=service

```

---

<div class="post-metadata">

**Author:** ![kb5won](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kb5won/32/4967_2.png) [@kb5won](https://forum.inductiveautomation.com/u/kb5won)\
**Post date:** [February 5, 2021, 6:34pm UTC](https://forum.inductiveautomation.com/t/gateway-auto-startup-on-linux/43018/9 "2021-02-05T18:34:07Z")

</div>

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

```auto
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?

---

<div class="post-metadata">

**Author:** ![kcollins](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kcollins/32/19646_2.png) [@kcollins](https://forum.inductiveautomation.com/u/kcollins)\
**Post date:** [February 5, 2021, 7:13pm UTC](https://forum.inductiveautomation.com/t/gateway-auto-startup-on-linux/43018/10 "2021-02-05T19:13:59Z")

</div>

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:

```auto
[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).

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 5, 2021, 7:54pm UTC](https://forum.inductiveautomation.com/t/gateway-auto-startup-on-linux/43018/11 "2021-02-05T19:54:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![chi](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@chi](https://forum.inductiveautomation.com/u/chi)\
**Post date:** [February 5, 2021, 9:08pm UTC](https://forum.inductiveautomation.com/t/gateway-auto-startup-on-linux/43018/12 "2021-02-05T21:08:28Z")

</div>

> [@kcollins](#):
>
> I’d double check the existence of that service definition, if the service is loading, that file _should_ be there

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.

---

<div class="post-metadata">

**Author:** ![kb5won](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kb5won/32/4967_2.png) [@kb5won](https://forum.inductiveautomation.com/u/kb5won)\
**Post date:** [February 8, 2021, 3:57am UTC](https://forum.inductiveautomation.com/t/gateway-auto-startup-on-linux/43018/13 "2021-02-08T03:57:18Z")

</div>

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! 🙂

---

<div class="post-metadata">

**Author:** ![kb5won](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kb5won/32/4967_2.png) [@kb5won](https://forum.inductiveautomation.com/u/kb5won)\
**Post date:** [February 8, 2021, 4:37am UTC](https://forum.inductiveautomation.com/t/gateway-auto-startup-on-linux/43018/14 "2021-02-08T04:37:18Z")

</div>

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
