Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4172060
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T00:31:03+00:00 2026-05-21T00:31:03+00:00

I have an application that runs in a user account (Plack-based) and want an

  • 0

I have an application that runs in a user account (Plack-based) and want an init script.

It seems as easy as “sudo $user start_server …”. I just wrote an LSB script using start-stop-daemon and it is really clumsy and verbose. It doesn’t feel like the right way.

After scouring for a bit and looking at a log of examples, I’m still not sure what the best way to do this is and there isn’t a cohesive guide that I’ve found.

Right now I have it working with:

start-stop-daemon --background --quiet --start --pidfile $PIDFILE \
                --make-pidfile --chuid $DAEMONUSER \
                --exec $DAEMON -- $DAEMON_OPTS

With DAEMON and DAEMON_OPTS as:

DAEMON="/home/mediamogul/perl5/perlbrew/perls/current/bin/start_server"
DAEMON_OPTS="--port $PORT -- starman --workers $WORKERS /home/mediamogul/MediaMogul/script/mediamogul.psgi"

This then requires me to adjust how to detect running, because it’s a perl script so perl is showing up as the command and not “start_server”.

(I’m running this out of a perlbrew on that user account so it is completely separate from the system perl, that’s why the paths are pointing to a perl in the user dir)

Is this really the best way to go about doing this? It seems very clunky to me, but I’m not an admin type.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T00:31:03+00:00Added an answer on May 21, 2026 at 12:31 am

    You can use the --pid option to starman to have it write the PID when the app starts, if you use the same filename as you give start-stop-daemon then it will work nicly.

    For example, from one of my init.d scripts:

    
    SITENAME=mysite
    PORT=5000
    DIR=/websites/mysite
    SCRIPT=bin/app.pl
    USER=davidp

    PIDFILE=/var/run/site-$SITENAME.pid

    case "$1" in
    start)
    start-stop-daemon --start --chuid $USER --chdir $DIR \
    --pidfile=$PIDFILE \
    --exec /usr/local/bin/starman -- -p $PORT $SCRIPT -D --pid $PIDFILE
    ;;
    stop)
    start-stop-daemon --stop --pidfile $PIDFILE
    ;;
    *)
    echo "Usage: $SCRIPTNAME {start|stop}" >&2
    exit 3
    ;;
    esac

    It's very close to what you are already doing, and I'll admit it is a little clumsy, granted, but it works - having Starman write the PID file means that start-stop-daemon can reliably start & stop it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a windows service that do something periodically. on user account runs systray
I have a windows service application that runs as Local System, and I want
I have created an application that runs in the taskbar. When a user clicks
I have a application that runs very well on JBoss using JSF 2. I
I have an application that runs on a shared hosting website - it is
I have an application that runs through the rounds in a tournament, and I
I have an application that runs on a client's server built on a SQL
I have an application that runs the a command as below: <command> <switches> >&
I use node.js and socket.io. I have an application that runs on the IP
I have a web application that runs fine under IIS5 or IIS6. I just

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.