placket + server_starter: seting user/group and background

54 views
Skip to first unread message

Alexey Skorikov

unread,
Sep 3, 2013, 3:52:01 AM9/3/13
to psgi-...@googlegroups.com
Hello, everyone

I'm running a PSGI app with Server Starter on Twiggy::Prefork:

/usr/local/bin/start_server --pid-file=$pidfile --port $bind_addr:$bind_port -- /usr/local/bin/plackup -s Twiggy::Prefork -a $application &

Could you please advice how can I set user/group for the spawned processes and to make the whole thing to run in background? So far the only fast and working solution for unbinding from STDOUT I found is putting ampersand at the end. I know earlier versions of plackup supported --user parameter, but it's so gone.

Thank you.

--
Alexey Skorikov

Tatsuhiko Miyagawa

unread,
Sep 3, 2013, 4:36:35 AM9/3/13
to psgi-...@googlegroups.com
On Tue, Sep 3, 2013 at 12:52 AM, Alexey Skorikov <kilob...@gmail.com> wrote:

> I know earlier versions of plackup supported --user parameter, but it's so gone.

No, plackup has never had --user.

Particular backends might have implemented it, like Starman, but it's
never been part of plackup.

> Could you please advice how can I set user/group for the spawned processes and to make the whole thing to run in background? So far the only fast and working solution for unbinding from STDOUT I found is putting ampersand at the end.

If the backend (Twiggy::Prefork in this case) doesn't support it, you
can use tools like setuidgid to set user/group then exec the process.
Some servers support --daemonize, but otherwise servers will run in
the foreground, so that you can daemonize it with tools such as
start-stop-daemon or Daemon::Control.


--
Tatsuhiko Miyagawa
Reply all
Reply to author
Forward
0 new messages