Daemons provides an easy way to wrap existing ruby scripts (for example a self-written server) to be run as a daemon and to be controlled by simple start/stop/restart commands.
Questions tagged [daemons]
105 questions
2
votes
2 answers
Starting and Stopping Ruby Daemons
I'm trying to start and stop an infinite loop daemon using the daemons gem.
Looking at the home page, I tried (in irb):
require 'daemons'
=>true
task_handle = Daemons.call do
loop{
sleep 10
puts "foo"
}
end
=>…
user684934
2
votes
1 answer
Ruby daemons soft stop
This simple daemon (written using ruby daemons gem) prints numbers from 0 up to 9 until I stop the daemon using the stop command line option:
require 'rubygems'
require 'daemons'
options = {
:multiple => false,
:ontop => false,
…

TheHuge_
- 1,039
- 17
- 29
2
votes
1 answer
How to get the pid for the first task with the Daemons gem?
I am trying to run multiple instances of the same code/script using the Daemons gem. I've been playing around with it in an IRB session and can't seem to get the functionality I'm looking for. I want to run the same script multiple times keeping…

Tomek
- 4,689
- 15
- 44
- 52
2
votes
1 answer
bash or something else: updating configuration files programmatically?
What's the best approach to update an /etc/rc.conf configuration file programmatically?
Specifically, on an arch linux machine, I want to be able to programmatically update
DAEMONS=(syslog-ng network sshd ntpd netfs crond)
to
DAEMONS=(syslog-ng…

Calvin Cheng
- 35,640
- 39
- 116
- 167
1
vote
1 answer
How to add methods/modules access control in Daemons?
I want disable the rm\_rf method of the FileUtils module in Ruby scripts.
When foo.rb contains:
FileUtils.rm_rf(file)
It should not be run by:
Daemons.run("foo.rb", some_options)
and should give an error message instead.
Does Daemons can do this?…

nttstar
- 341
- 2
- 10
1
vote
0 answers
kill a thread depending on existing of main_thread
I want to create an endless thread with python3.7 that receives an input signal in the background. It should stop when my program, so main stops.
I set my thread to daemon=True but it just continues running. I also checked the Daemon-state…

curiesse
- 11
- 2
1
vote
1 answer
Keep publishing data via publisher RabbitMQ (ruby bunny)
I have a RabbitMQ with bunny working using consumer.rb and publisher.rb. If I run
ruby consumer.rb
and then
publisher.rb
I get data being published (data coming from another class). Data prints like this on ruby consumer.rb when I run…

Pav
- 19
- 1
- 4
1
vote
2 answers
Daemonizing Celery--No module named 'celery' error
I'm trying to daemonize Celery 4.3.0 on Ubuntu 18 following the official documentation. This is for a Django project to off-load intensive tasks.
When the server is running the celery.service should make the Celery worker available to process tasks.…

Owen
- 51
- 5
1
vote
1 answer
How do I run Ruby daemons as a specific user?
I am trying to run a Ruby daemon using the daemons gem.
It will be started as user 'joe' but needs to change to 'www-data' once it's demonized so that it can access the files it will be working on.
I can see that daemons has change_privilege method…

Val
- 124
- 1
- 9
1
vote
0 answers
How many processes should my daemon have?
I have an ubuntu server with a nuxt.js app (Vue.js).
On deploy I build the app and I have a daemon which runs and which I kill at the end of the deployment (so it restarts basically).
My question is: How many processes should I have for the daemon…

mauxtin
- 388
- 2
- 5
- 15
1
vote
1 answer
How to start a daemon in python using multiprocessing
I want to start a daemon process using multiprocessing exiting the main thread. I wrote this code:
import multiprocessing as mp
from time import sleep
def mytarget():
while True:
print "yes"
sleep(1)
process =…

Fomalhaut
- 8,590
- 8
- 51
- 95
1
vote
3 answers
iOS daemons. are they legal for AppStore?
Can't find out if daemon application can be run on non-jailbroken iPhone. And what is Apple policy about this stuff? I don't really know if my idea is possible at all... I wonder if it's possible to create such a daemon that can intercept outcoming…

heximal
- 10,327
- 5
- 46
- 69
1
vote
1 answer
starting and stopping a daemon at user login logout
I have a daemon script written in ruby which responds to commands like daemon start and daemon stop. It's executable with shebang #!/usr/bin/env ruby and it works invoked from terminal. I need to start the daemon on login and stop it on…

kfl62
- 2,434
- 4
- 29
- 40
1
vote
1 answer
Start Docker Daemon as other user
Guys, I need to start docker daemon as other user under my Ubuntu 14.04..
I have this user in the sudoers' group and in the docker's group, but, what I need is the docker daemon running as my "test" user.
test@test:/usr/bin$ start docker
start:…

Maicon Baum
- 15
- 2
1
vote
0 answers
Communication from Daemon-to-Binary Applications Design for Mac OS X
I am Designing an application that requires a Command Line Application binary to use for remote/local usage. The application will have plugins that will allow for addition and removal by the user.
Will NSDistributedNotificationCenter work for…

Denis Arsenault
- 11
- 2