# Autostart FactoryPMI in linux

**URL:** <https://forum.inductiveautomation.com/t/autostart-factorypmi-in-linux/955>\
**Category:** Archived Topics\
**Created:** [January 22, 2009, 8:29am UTC](https://forum.inductiveautomation.com/t/autostart-factorypmi-in-linux/955 "2009-01-22T08:29:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [January 22, 2009, 8:29am UTC](https://forum.inductiveautomation.com/t/autostart-factorypmi-in-linux/955/1 "2009-01-22T08:29:29Z")

</div>

Hey guys, long time no see,

I am trying to set up FactoryPMI on an ubuntu host, and all is going extremely well, however, I do have one issue.

I moved startGateway.sh to /etc/init.d, and modified it to statically point to my install dir (/usr/local/FactoryPMI). When i run the script manually, it runs fine. However after adding the scripts to the various run levels(update-rc.d startGateway.sh defaults), the machine no longer boots up all the way, freezing at the startGateway script. No, I assume I shouldnt’ be running this script at each run level, ad presume run level 5 would be when I want to start it, but need some hand holding. Any ideas?

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [January 22, 2009, 3:42pm UTC](https://forum.inductiveautomation.com/t/autostart-factorypmi-in-linux/955/2 "2009-01-22T15:42:44Z")

</div>

maybe you just need to have the script run the Gateway process in the background. It is probably waiting for the script to finish, which means that it is waiting for FactoryPMI Gateway to stop, which of course it doesn’t want to do.

Try adding an ampersand (&) to the end of the java command, like

```auto
java -classpath [..snip] ...gateway.Service &
```

---

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [January 22, 2009, 4:24pm UTC](https://forum.inductiveautomation.com/t/autostart-factorypmi-in-linux/955/3 "2009-01-22T16:24:17Z")

</div>

Nice, that worked. Do you know the command to stop the gateway, so I can also add that to the script?

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [January 22, 2009, 4:28pm UTC](https://forum.inductiveautomation.com/t/autostart-factorypmi-in-linux/955/4 "2009-01-22T16:28:21Z")

</div>

hmm…there isn’t really one, unless you were to write a program/script that emulated the “Monitor Gateway” app and hook into that app’s localhost-only control interface…
