Re: [Mojolicious] Re: hypnotoad systemd start problem

2017-12-04 Thread Dan Book
I just came across another solution for the /var/run directory for RHEL 7.x or any other system using systemd in this way: Create a file in /etc/tmpfiles.d like /etc/tmpfiles.d/myapp.conf containing this line: d /var/run/myapp 775 my_user my_user Replacing myapp with the /var/run directory you w

Re: [Mojolicious] Re: hypnotoad systemd start problem

2017-11-26 Thread david6228
Hi Daniel, Thank you very much. David 在 2017年11月26日星期日 UTC+8下午10:02:43,Daniel Mantovani写道: > > Hi David, > Exactly, thats why you should check what are the differences among both > cases (manual start vs systemd start). That means checking perl that end up > called in each case (probably loo

Re: [Mojolicious] Re: hypnotoad systemd start problem

2017-11-26 Thread Daniel Mantovani
Hi David, Exactly, thats why you should check what are the differences among both cases (manual start vs systemd start). That means checking perl that end up called in each case (probably looking at the shebang line at invoqued hypnotoad), relevant environment variables, running directory, users

Re: [Mojolicious] Re: hypnotoad systemd start problem

2017-11-24 Thread david6228
Hi Dan, Thank you help, the error output that is result of run journalctl -u mojo_test. David 在 2017年11月25日星期六 UTC+8上午12:14:30,Dan Book写道: > > Please check journalctl to find the real error that occurs before the > lines you pasted. journalctl -u mojo_test.service > > -Dan > > On Fri, Nov

Re: [Mojolicious] Re: hypnotoad systemd start problem

2017-11-24 Thread david6228
Hi Daniel, Thank you gudie, but it's running ok when manually start. I try to check the perl. David 在 2017年11月24日星期五 UTC+8下午9:58:54,Daniel Mantovani写道: > > Hi David, those 'Compilation failed in require at ... ' normally mean that > perl is not able to find some modules at an "use" o

Re: [Mojolicious] Re: hypnotoad systemd start problem

2017-11-24 Thread Dan Book
Please check journalctl to find the real error that occurs before the lines you pasted. journalctl -u mojo_test.service -Dan On Fri, Nov 24, 2017 at 5:34 AM, wrote: > Hi Daniel, > Thank you deltail adivces. > I test follow your guide, but it's error same as I report before, it's in > Mojoliciou

Re: [Mojolicious] Re: hypnotoad systemd start problem

2017-11-24 Thread Daniel Mantovani
Hi Dan, thanks for your comments. The problem I run into when tried to create the /run/myapp or /var/run/myapp directory manually or by a separate mechanism is that depending on the host system it will be deleted during a reboot. For instance in RHEL 7.x /var/run (or /run, it is a symlink to it

Re: [Mojolicious] Re: hypnotoad systemd start problem

2017-11-24 Thread Daniel Mantovani
Hi David, those 'Compilation failed in require at ... ' normally mean that perl is not able to find some modules at an "use" or "require" function call. You probably have to review those files at the lines mentioned, also which perl are using in each case (whether you are using system perl, or

[Mojolicious] Re: hypnotoad systemd start problem

2017-11-24 Thread david6228
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

Re: [Mojolicious] Re: hypnotoad systemd start problem

2017-11-24 Thread david6228
Hi Daniel, Thank you deltail adivces. I test follow your guide, but it's error same as I report before, it's in Mojolicious 7.57. I once change Mojolicious to 6.58 to test, it's still error, error output: [root@localhost ~]# systemctl status mojo_test.service ● mojo_test.service - My Mojolicious

Re: [Mojolicious] Re: hypnotoad systemd start problem

2017-11-23 Thread Dan Book
The way that hot-restart works is that the USR2 signal is sent to the currently running manager, which itself will spawn a new manager and then wait for it to be ready, then exit. I don't think that Type=simple will correctly track the new process when this happens since the new process was not spa

Re: [Mojolicious] Re: hypnotoad systemd start problem

2017-11-23 Thread Dan Book
The best practice IMO in regards to permissions for the run and log directories is to make subdirectories of /var/run and /var/log owned by the user that will be running hypnotoad, and put the pidfile/logfiles in there. The other issue though is if you are running hypnotoad to listen on a privileg

Re: [Mojolicious] Re: hypnotoad systemd start problem

2017-11-23 Thread Daniel Mantovani
Hi, Type=forking should work just fine, I am not sure that with Type=simple you will have all the functionallity you can get from systemd. A couple of advices though: 1) to get more confortable with systemd, you probably want to replicate as much as possible the example in Mojolicious::Guides:

Re: [Mojolicious] Re: hypnotoad systemd start problem

2017-11-23 Thread Boyd Duffee
On 23/11/17 16:14, Dan Book wrote: > I would not recommend running hypnotoad as a Type=simple service with -f. > This will not allow you to use hot-restarts via systemctl reload. Naively, I _can_ hot-restart with systemctl reload servicename, but now you've got me worried. Any idea why it's not ad

Re: [Mojolicious] Re: hypnotoad systemd start problem

2017-11-23 Thread Dan Book
I would not recommend running hypnotoad as a Type=simple service with -f. This will not allow you to use hot-restarts via systemctl reload. -Dan On Thu, Nov 23, 2017 at 10:13 AM, wrote: > Hi David, > > I'm no expert with systemd, but this is my mojo.service file which runs > the application in

[Mojolicious] Re: hypnotoad systemd start problem

2017-11-23 Thread b . duffee
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