[systemd-devel] Unable to get Systemd to work with Phoenix/Elixir Exrm Release

Michael Chavez bigbassroller at gmail.com
Thu Jul 7 20:44:35 UTC 2016


Hi Andrei,

That worked, thank you so much!

Here is the final of  the hello-phoenix.service:
[Unit]
Description=hello-phoenix service

[Service]
WorkingDirectory=/home/hello-phoenix/app/bin
ExecStart=/home/hello-phoenix/app/bin/hello_phoenix foreground
Environment=MIX_ENV=prod PORT=8888
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=hello-phoenix
User=hello-phoenix

[Install]
WantedBy=multi-user.target

Thank you and everyone for your insights:)

Cheers,
Michael


Sincerely,
Michael Chavez, Web Developer
Space-Rocket | web and graphic design

M: 415-724-7935

W: http://www.space-rocket.com/

On Thu, Jul 7, 2016 at 8:36 AM, Andrei Dziahel <develop7 at develop7.info>
wrote:

> Hi Michael,
>
> How did you get this /home/hello-phoenix/app/bin/hello_phoenix script
> anyway? If it is generated by exrm, I'd suggest to try "hello_phoenix
> foreground" in ExecStart directive — it'd prevent forking and detaching
> from console (it is unnecessary if being supervised by systemd).
>
> 2016-07-07 17:29 GMT+03:00 Michael Chavez <bigbassroller at gmail.com>:
>
>> Hello,
>>
>> I am a newbie trying to get systemd to load my phoenix/elixir app.
>>
>> I have tried many variations of my hello-phoenix service file, the
>> version that I feel is closest to being correct looks like this:
>> [Unit]
>> Description=hello-phoenix service
>>
>> [Service]
>> WorkingDirectory=/home/hello-phoenix/app/bin
>> ExecStart=/home/hello-phoenix/app/bin/hello_phoenix start
>> Environment=MIX_ENV=prod PORT=8888
>> Restart=always
>> StandardOutput=syslog
>> StandardError=syslog
>> SyslogIdentifier=hello-phoenix
>> User=hello-phoenix
>>
>> [Install]
>> WantedBy=multi-user.target
>>
>> after reloading daemon, enabling and starting the hello-phoenix.service,
>> systemctl status hello-phoenix.service outputs:
>>
>> ● hello-phoenix.service - hello-phoenix service
>>    Loaded: loaded (/etc/systemd/system/hello-phoenix.service; enabled)
>>    Active: failed (Result: start-limit) since Thu 2016-07-07 10:14:30
>> EDT; 9min ago
>>   Process: 4281 ExecStart=/home/hello-phoenix/app/bin/hello_phoenix start
>> (code=exited, status=0/SUCCESS)
>>  Main PID: 4281 (code=exited, status=0/SUCCESS)
>>
>> Jul 07 10:14:30 Phoenix1 systemd[1]: hello-phoenix.service start request
>> repeated too quickly, refusing to start.
>> Jul 07 10:14:30 Phoenix1 systemd[1]: Failed to start hello-phoenix
>> service.
>> Jul 07 10:14:30 Phoenix1 systemd[1]: Unit hello-phoenix.service entered
>> failed state.
>> Jul 07 10:14:33 Phoenix1 systemd[1]: hello-phoenix.service start request
>> repeated too quickly, refusing to start.
>> Jul 07 10:14:33 Phoenix1 systemd[1]: Failed to start hello-phoenix
>> service.
>>
>> and journalctl -xn outputs:
>> -- Logs begin at Wed 2016-07-06 16:21:33 EDT, end at Thu 2016-07-07
>> 10:17:01 EDT. --
>> Jul 07 10:14:30 Phoenix1 systemd[1]: Failed to start hello-phoenix
>> service.
>> -- Subject: Unit hello-phoenix.service has failed
>> -- Defined-By: systemd
>> -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>> --
>> -- Unit hello-phoenix.service has failed.
>> --
>> -- The result is failed.
>> Jul 07 10:14:30 Phoenix1 systemd[1]: Unit hello-phoenix.service entered
>> failed state.
>> Jul 07 10:14:33 Phoenix1 sudo[4319]: root : TTY=pts/2 ; PWD=/root ;
>> USER=root ; COMMAND=/bin/systemctl start hello-phoenix.service
>> Jul 07 10:14:33 Phoenix1 sudo[4319]: pam_unix(sudo:session): session
>> opened for user root by root(uid=0)
>> Jul 07 10:14:33 Phoenix1 systemd[1]: hello-phoenix.service start request
>> repeated too quickly, refusing to start.
>> Jul 07 10:14:33 Phoenix1 systemd[1]: Failed to start hello-phoenix
>> service.
>> -- Subject: Unit hello-phoenix.service has failed
>> -- Defined-By: systemd
>> -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>> --
>> -- Unit hello-phoenix.service has failed.
>> --
>> -- The result is failed.
>> Jul 07 10:14:33 Phoenix1 sudo[4319]: pam_unix(sudo:session): session
>> closed for user root
>> Jul 07 10:17:01 Phoenix1 CRON[4342]: pam_unix(cron:session): session
>> opened for user root by (uid=0)
>> Jul 07 10:17:01 Phoenix1 CRON[4343]: (root) CMD (   cd / && run-parts
>> --report /etc/cron.hourly)
>> Jul 07 10:17:01 Phoenix1 CRON[4342]: pam_unix(cron:session): session
>> closed for user root
>>
>> Anybody have any ideas on what I am doing wrong? I am on day two of
>> ramming my head against the wall trying to figure out. Any help would
>> greatly appreciated.
>>
>> Thanks and Cheers,
>> Michael
>>
>> Sincerely,
>> Michael Chavez, Web Developer
>> Space-Rocket | web and graphic design
>>
>> M: 415-724-7935
>>
>> W: http://www.space-rocket.com/
>>
>> _______________________________________________
>> systemd-devel mailing list
>> systemd-devel at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>>
>>
>
>
> --
> Regards,
> Andrei Dziahel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160707/f08feacc/attachment.html>


More information about the systemd-devel mailing list