Hi Boyd, thank you suggestion.
I test that use your service unit configuration, result same error 
(mojolicious 7.57).
I also change Mojolicious to 6.58, it's still error, but it's different, 
error output is:

[root@localhost ~]# systemctl status mojo
● mojo.service - My Mojolicious application
   Loaded: loaded (/usr/lib/systemd/system/mojo.service; enabled; vendor 
preset: disabled)
   Active: active (exited) (Result: exit-code) since Fri 2017-11-24 
17:26:52 CST; 1min 29s ago
  Process: 1104 ExecStart=/root/perl5/bin/hypnotoad 
/usr/local/manager-application/script/manager_app -f (code=exited, status=2)
 Main PID: 1104 (code=exited, status=2)
   CGroup: /system.slice/mojo.service

Nov 24 17:26:52 localhost.localdomain mojolicious[1104]: Compilation failed 
in require at /usr/local/share/perl5/Mojo/Server.pm line 6.
Nov 24 17:26:52 localhost.localdomain mojolicious[1104]: BEGIN 
failed--compilation aborted at /usr/local/share/perl5/Mojo/Server.pm line 6.
Nov 24 17:26:52 localhost.localdomain mojolicious[1104]: Compilation failed 
in require at /usr/local/share/perl5/Mojo/Base.pm line 77.
Nov 24 17:26:52 localhost.localdomain mojolicious[1104]: BEGIN 
failed--compilation aborted at /usr/local/share/perl5/Mojo/Server/Daemon.pm 
line 2.
Nov 24 17:26:52 localhost.localdomain mojolicious[1104]: Compilation failed 
in require at /usr/local/share/perl5/Mojo/Base.pm line 77.
Nov 24 17:26:52 localhost.localdomain mojolicious[1104]: BEGIN 
failed--compilation aborted at 
/usr/local/share/perl5/Mojo/Server/Prefork.pm line 2.
Nov 24 17:26:52 localhost.localdomain mojolicious[1104]: Compilation failed 
in require at /usr/local/share/perl5/Mojo/Server/Hypnotoad.pm line 9.
Nov 24 17:26:52 localhost.localdomain mojolicious[1104]: BEGIN 
failed--compilation aborted at 
/usr/local/share/perl5/Mojo/Server/Hypnotoad.pm line 9.
Nov 24 17:26:52 localhost.localdomain mojolicious[1104]: Compilation failed 
in require at /root/perl5/bin/hypnotoad line 20.
Nov 24 17:26:52 localhost.localdomain systemd[1]: mojo.service: main 
process exited, code=exited, status=2/INVALIDARGUMENT

I surprise that why your Hypnotoad of Mojolicious 6.58 is in 
usr/local/bin/, mine is in /root/perl5/bin, we are all use centos 7 and 
perl v5.16.3, it's same.

David



在 2017年11月23日星期四 UTC+8下午11:13:37,b.du...@keele.ac.uk写道:
>
> Hi David,
>
> I'm no expert with systemd, but this is my mojo.service file which runs 
> the application in /usr/local/manager-application and works for me.   My 
> differences are in the Service tag.
> mojo.service
> [Unit]
> Description=My Mojolicious application
> Requires=network.target
> After=network.target
>
> [Service]
> Type=simple
> RemainAfterExit=yes
> SyslogIdentifier=mojolicious
>
> WorkingDirectory=/usr/local/manager-application
> ExecStart=/usr/local/bin/hypnotoad script/manager_app -f
> ExecStop=/usr/local/bin/hypnotoad --stop script/manager_app
> ExecReload=/usr/local/bin/hypnotoad script/manager_app 
> <http://mojo_test.pl>
>
> Restart=on-abort
> RestartSec=90s
>
> [Install]
> WantedBy=multi-user.target
>
> running
> CentOS 7
> perl 5.16.3
> mojolcious 6.58
>
> (file transcribed by hand, so watch for speling mistakes)  HTH
>
> Boyd
>
> On Thursday, 23 November 2017 09:24:40 UTC, davi...@gmail.com wrote:
>>
>> Dear sir;
>>      I meet a problem when systemd start hypnotoad, detail follow:
>>
>>
>> mojo_test.service
>> [Unit]
>> Description=My Mojolicious application
>> Requires=network.target
>> After=network.target
>>
>> [Service]
>> Type=forking
>> PIDFile=/run/mojo_test.pid
>> ExecStart=/usr/local/bin/hypnotoad /home/mojo_test.pl
>> ExecStop=/usr/local/bin/hypnotoad -s /home/mojo_test.pl
>> ExecReload=/usr/local/bin/hypnotoad /home/mojo_test.pl
>> KillMode=process
>>
>> [Install]
>> WantedBy=multi-user.target
>>
>> use /home/hypnotoad mojo_test.pl start to run is ok. 
>> the running enviorments:
>> centos 7
>> perl v5.16
>> mojolicious new update
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to