systemd and attach

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

systemd and attach

Sid Muller
Hi there-

I am trying to get a rebar style application to work with systemd as a service and it's mostly working. The application comes up just as if I typed in "bin/test start" but when I type "bin/test attach" then the shell just hangs in this state:
===================================================
root@test:/test# bin/test attach
Attaching to /tmp/erl_pipes/test/erlang.pipe.1 (^D to exit)

^L
===================================================

But when I run "systemctl stop test.service" and then "bin/test start" the "bin/test attach" works fine. I have not been able to get attach to work with systemd no matter what I try. My systemd script is:

--------------------------------------------------
[Unit]
Description=test
Requires=network-online.target remote-fs-pre.target
Before=remote-fs-pre.target
After=network.target network-online.target
Conflicts=shutdown.target reboot.target
Before=shutdown.target reboot.target

[Service]
Type=forking
WorkingDirectory=/test
ExecStart=/test/bin/test start
ExecStop=/test/bin/test stop
SuccessExitStatus=0 1


[Install]
WantedBy=multi-user.target
---------------------------------------------------

Does anyone have any suggestions? I am stumped.
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: systemd and attach

Roger Lipscombe-2
Not a direct answer to your question, but we generally use "bin/test
foreground" to run the service (i.e. non-forking) and then use
"bin/test remote_console", rather than "attach".

On 24 December 2017 at 15:20, Sid Muller <[hidden email]> wrote:

> Hi there-
>
> I am trying to get a rebar style application to work with systemd as a service and it's mostly working. The application comes up just as if I typed in "bin/test start" but when I type "bin/test attach" then the shell just hangs in this state:
> ===================================================
> root@test:/test# bin/test attach
> Attaching to /tmp/erl_pipes/test/erlang.pipe.1 (^D to exit)
>
> ^L
> ===================================================
>
> But when I run "systemctl stop test.service" and then "bin/test start" the "bin/test attach" works fine. I have not been able to get attach to work with systemd no matter what I try. My systemd script is:
>
> --------------------------------------------------
> [Unit]
> Description=test
> Requires=network-online.target remote-fs-pre.target
> Before=remote-fs-pre.target
> After=network.target network-online.target
> Conflicts=shutdown.target reboot.target
> Before=shutdown.target reboot.target
>
> [Service]
> Type=forking
> WorkingDirectory=/test
> ExecStart=/test/bin/test start
> ExecStop=/test/bin/test stop
> SuccessExitStatus=0 1
>
>
> [Install]
> WantedBy=multi-user.target
> ---------------------------------------------------
>
> Does anyone have any suggestions? I am stumped.
> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: systemd and attach

Ferenc Holzhauser
I think I've seen this issue with attach when the TERM environment wasn't set for some reason.
Perhaps you could try to add the environment to the [Service] and see whether it helps.
...
Environment=TERM=xterm
...

On 27 December 2017 at 10:49, Roger Lipscombe <[hidden email]> wrote:
Not a direct answer to your question, but we generally use "bin/test
foreground" to run the service (i.e. non-forking) and then use
"bin/test remote_console", rather than "attach".

On 24 December 2017 at 15:20, Sid Muller <[hidden email]> wrote:
> Hi there-
>
> I am trying to get a rebar style application to work with systemd as a service and it's mostly working. The application comes up just as if I typed in "bin/test start" but when I type "bin/test attach" then the shell just hangs in this state:
> ===================================================
> root@test:/test# bin/test attach
> Attaching to /tmp/erl_pipes/test/erlang.pipe.1 (^D to exit)
>
> ^L
> ===================================================
>
> But when I run "systemctl stop test.service" and then "bin/test start" the "bin/test attach" works fine. I have not been able to get attach to work with systemd no matter what I try. My systemd script is:
>
> --------------------------------------------------
> [Unit]
> Description=test
> Requires=network-online.target remote-fs-pre.target
> Before=remote-fs-pre.target
> After=network.target network-online.target
> Conflicts=shutdown.target reboot.target
> Before=shutdown.target reboot.target
>
> [Service]
> Type=forking
> WorkingDirectory=/test
> ExecStart=/test/bin/test start
> ExecStop=/test/bin/test stop
> SuccessExitStatus=0 1
>
>
> [Install]
> WantedBy=multi-user.target
> ---------------------------------------------------
>
> Does anyone have any suggestions? I am stumped.
> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions