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 233605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:06:59+00:00 2026-05-11T20:06:59+00:00

I need an application to be running in the background on my web server,

  • 0

I need an application to be running in the background on my web server, but I need to be able to start/stop the application with root privileges.

In order to do this, I want to have a service running that has root privileges, so that it can kill the application, and start it up again if need be.

Finally, I need to be able to send the start and kill commands to the service via Apache/PHP, so that it can be indirectly controlled through the web.

How do I create a Linux service?
How do I communicate with a Linux service in this manner?

Thanks in advance!

  • 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-11T20:06:59+00:00Added an answer on May 11, 2026 at 8:06 pm

    Use the exec command in your PHP script to call shell files. The shell files can be setup with the “setuser” bit so it will run as its owner (instead of running with the web server’s permissions).

    Of course, you’ll need to be very careful–lots of testing, monitoring, etc.

    Finally, think about the service running as a dedicated user, not as root. Eg like apache and most other well done services do.

    Added: Re: running a service in Linux. Depends on your flavor of Linux. If you want to be sure that your app service will be automatically re-started if it fails, plus logging, checkout Runit:

    https://web.archive.org/web/1/http://blogs.techrepublic%2ecom%2ecom/opensource/?p=202

    http://smarden.org/runit

    Added: Instead of setuid bit, I think Frank’s suggestion (in comment) of using sudo system is better.

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

Sidebar

Related Questions

In our wicket application I need to start a long-running operation. It will communicate
Oracle Application server 10g I need to run the long running reports in the
I need to detect information about the Application Server my EJBs are running in.
In the java web application need to select the file from server and print
I want to develop an application in blackberry that is running in background and
I need to do some background tasks for a web application i'm building. I
I need to get the path (not the executable) where my application is running
I need to find out which account is running one of my websites application
I need to connect to a MongoDB instance from my EJB3 application, running on
Is there any way to disable my application from running on the background? I

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.