start-stop-daemon

how can I run rails server daemon?

徘徊边缘 提交于 2019-12-02 17:08:57
I am new at rails world and need to run my rails test server in daemon mode.. I've noticed that there is a a -d flag but its not working for me.. rails -s -d shouldn't it be like this? it's worth trying the following command $ rails s -d It should be: rails s -d # to kill the server kill `cat tmp/pids/server.pid` 来源: https://stackoverflow.com/questions/14964002/how-can-i-run-rails-server-daemon

What is start-stop-daemon in linux scripting?

ぐ巨炮叔叔 提交于 2019-11-28 17:14:25
问题 What is start-stop-daemon and how should it be used? I am trying to automate a particular program to run. Whenever the system starts, the program should run. For that I am writing script in /etc/init.d/ location. 回答1: It is a program to manage the start and stop of system level background processes (daemons). You use it by passing in parameters (such as the pid file to create/check) and command arguments for the process you want to launch. Then, you do one of two things: start-stop-daemon -S

Start JBoss 7 as a service on Linux

喜你入骨 提交于 2019-11-28 15:19:45
Previous versions of JBoss included a scripts (like jboss_init_redhat.sh ) that could be copied to /etc/init.d in order to add it as a service - so it would start on boot up. I can't seem to find any similar scripts in JBoss 7. Has anyone already done something like this? P.S. I'm trying to achieve this in Ubuntu 10.04 After spending a couple of hours of snooping around I ended up creating /etc/init.d/jboss with the following contents #!/bin/sh ### BEGIN INIT INFO # Provides: jboss # Required-Start: $local_fs $remote_fs $network $syslog # Required-Stop: $local_fs $remote_fs $network $syslog #

Start & Stop a ScheduledExecutorService in Java EE environment using servlet

北城以北 提交于 2019-11-28 13:53:37
We have a requirement where in we need to monitor remote JVM details via JMX using a simple servlet application. So things done till now in a standalone application is 1) Creat a JMX connector & get the Memory data --> done 2) We need to constantly monitor & get the records (2.1 > which can be considered as scheduled task at constant delay & insert the records into DB Or 2.2> does the JMX gives the history if yes which MBean to access for the info?). Here I am planning to use an interface to register the domain , followed to it. Have start & stop button from JSP. The functionality been when we

How can I log the stdout of a process started by start-stop-daemon?

落爺英雄遲暮 提交于 2019-11-28 02:48:07
I am using an init script to run a simple process, which is started with: start-stop-daemon --start --quiet --chuid $DAEMONUSER \ --make-pidfile --pidfile $PIDFILE --background \ --exec $DAEMON $DAEMON_ARGS The process called $DAEMON usually prints log information to its standard output. As far as I can tell this data is not being stored anywhere. I would like to write or append the stdout of $DAEMON to a file somewhere. The only solution I know is to tell start-stop-daemon to call a shellscript instead of $DAEMON directly; the script then calls $DAEMON and writes to the logfile. But that

How can I log the stdout of a process started by start-stop-daemon?

狂风中的少年 提交于 2019-11-26 23:49:29
问题 I am using an init script to run a simple process, which is started with: start-stop-daemon --start --quiet --chuid $DAEMONUSER \ --make-pidfile --pidfile $PIDFILE --background \ --exec $DAEMON $DAEMON_ARGS The process called $DAEMON usually prints log information to its standard output. As far as I can tell this data is not being stored anywhere. I would like to write or append the stdout of $DAEMON to a file somewhere. The only solution I know is to tell start-stop-daemon to call a

How to process SIGTERM signal gracefully?

人盡茶涼 提交于 2019-11-26 03:23:22
问题 Let\'s assume we have such a trivial daemon written in python: def mainloop(): while True: # 1. do # 2. some # 3. important # 4. job # 5. sleep mainloop() and we daemonize it using start-stop-daemon which by default sends SIGTERM ( TERM ) signal on --stop . Let\'s suppose the current step performed is #2 . And at this very moment we\'re sending TERM signal. What happens is that the execution terminates immediately. I\'ve found that I can handle the signal event using signal.signal(signal

How to process SIGTERM signal gracefully?

ぃ、小莉子 提交于 2019-11-26 03:14:28
Let's assume we have such a trivial daemon written in python: def mainloop(): while True: # 1. do # 2. some # 3. important # 4. job # 5. sleep mainloop() and we daemonize it using start-stop-daemon which by default sends SIGTERM ( TERM ) signal on --stop . Let's suppose the current step performed is #2 . And at this very moment we're sending TERM signal. What happens is that the execution terminates immediately. I've found that I can handle the signal event using signal.signal(signal.SIGTERM, handler) but the thing is that it still interrupts the current execution and passes the control to