Hot answers tagged daemon
8
Two things:
You should always check return values from system and library functions. If you had
if(remove(dirp->d_name)<0)
perror(dirp->d_name);
else
files_deleted++;
then you'd see what was happening.
The reason your code doesn't work is because remove() and unlink() require the full path to the file in question, whereas readdir() ...
6
You don't need anything special to make a daemon, really. Any program in any language can "daemonize" itself. Alternatively, you can daemonize an existing program with a small shell script wrapper (for instance the /etc/init.d program launcher can take care of it).
Typically, a daemon has the following properties :
working directory must be /
STDIN must ...
6
In most linux distributions you can manually start/stop services by (as root or using sudo) running the following commands:
# /etc/init.d/apache2 start
# /etc/init.d/mysqld start
# /etc/init.d/apache2 stop
# /etc/init.d/mysqld stop
Which services that are automatically started is controlled by file links in /etc/rc[runlevel].d/ .
Find your current ...
4
Ubuntu 10.04 is in the middle of a transition between two service management systems: SysVinit (the traditional system, used by most Linux distributions) and Upstart (a newer system pushed by Ubuntu and becoming available in more and more distributions).
SysVinit service management scripts are in /etc/init.d. You can start the service with ...
4
I had the same problem using CentOS 6 with supervisor 2. I will assume you run a similar configuration.
In my case, upgrading solved the problem. However, there are no available up to date supervisord binary package for my system. So here is how I have updated:
First, download the following source RPM supervisor-3.0-0.5.a10.fc16.src.rpm (available here: ...
3
Use the netstat tool. For example:
netstat -pan
Look under the section that says "LISTEN" and it will tell you what ports the daemons are listening on. Note that you should run this as root unless the daemon is running as the user you're logged in as.
3
To start a script in non-interacting session, use nohup (it will detach your process in a standalone term).
To make your script executable, use chmod ugoa+x <script_name>.
The last point, do not use #!/bin/bash or #!/bin/sh because you don't know if resides in /bin; try using #!/usr/bin/env bash (or sh) which forces the process to work under bash ...
3
After you put plist in /Library/LaunchDaemons you need to run command sudo launchctl load -w /Library/LaunchDaemons/your.plist
See man launchctl for the -w flag (it does exactly what you need)
Edit: did you set the RunAtLoad key to true in your plist?
Edit2: I forgot, RunAtLoad has no influence on autolaunch, it is all bout Disabled key.
2
In fact there is a way to auto-chown files created in a certain directory. Let's say the files you want lighttpd to be able to access are in /var/www. Then you set the group of /var/www to your group and set the SGID bit on /var/www. You will probably want to do this recursively for subdirs. I'm assuming the group is www-data.
chgrp -R www-data /var/www
...
2
You wanna use Deluge. It's awesome.
From the About Deluge page:
Core/UI split allowing Deluge to run as a daemon
Connect remotely to the Deluge daemon
Web UI
Console UI
GTK+ UI
BitTorrent Protocol Encryption
Mainline DHT
Local Peer Discovery (aka LSD)
FAST protocol extension
µTorrent Peer Exchange
UPnP and NAT-PMP
Proxy support
Web seed
Private Torrents
...
2
Allmost all GNU/Linux torrents have daemons these days. I personally use Transmission, but you can also use Deluge, uTorrent and many others.
2
For pure daemon usage on a headless server, rtorrent would be the client I would go to. It's command-line and very feature complete, although it's not the easiest thing to set up being purely command line. There are numerous web interfaces to rtorrent as well, although, again, they don't seem to be very easy to set up.
For GUI clients, I prefer ...
2
In most clients you can type '/quote version' or just '/version' and it will query the server, which by default on most IRCds will respond with the info, like:
-> Odd server stuff: "351 InspIRCd-1.2 hub.yourdomain.com :FreeBSD hub.yourdomain.com 6
.2-RELEASE (InspIRCd-1.2.1) [FLAGS=0,kqueue,196]" (hub.yourdomain.com)
005 WALLCHOPS WALLVOICES MODES=19 ...
2
1) Cygwin has inetd, and you could configure that to launch your code. Once you get the Cygwin base install could also use Cygwin perl/php/python, even bash to be a net daemon.
2) you could run any of these under apache, which is the most common way of running net code for most of these scripts. You'd have to be ok with wrapping your data in HTTP, but it ...
2
A service is bound by regular permission restrictions. It all depends on what user the service runs as. Services are just regular processes that are always running.
For example,
$ ps aux | grep apache2
root 2845 0.0 0.2 75596 4508 ? Ss Sep06 0:19 /usr/sbin/apache2 -k start
www-data 25608 0.0 0.1 74428 2232 ? S Sep09 0:00 ...
2
You don't mention what OS you are running so I'm going to assume it is a Windows variant from 2000 or later. All recent Windows variants have a task scheduler and the "windows scripting host" through which you can run scripts written in vbscript or jscript, so a simple way to do what you are looking for without installing extra software is:
create a text ...
2
I use Rainlendar. Lite version is freeware and contains the functionality you need.
While the reminder doesn't blink it will pop on top of other windows and you get a sound alarm with it. You can set one time events or recurring events. You can also select what sound you want to play for the reminder.
2
Since a daemon is a program that is a background process (that is, a process that doesn't involve any interaction on your part in doing what it does), and persists until the process is killed (lets say via an init script you wrote for this very thing), then yes. If you daemonize uWGSI, it will run until you kill the process spawned by the daemon.
You might ...
1
I typed sudo crontab -e and then selected nano as my editor. It brought up nano with the below comments. I added my script at the bottom and then rebooted. My tasks are now running whenever the system is booted.
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different ...
1
Have you located and tried running the service the service in /etc/init.d/(service name)?
I am unfamiliar with invoking services without actually running the shell program located under init.d folder but I am sure if the shell program to start the service is located under init.d then it should be an easy setup so you can invoke it the way you wish - ...
1
Running
pulseaudio -v
in a terminal (run pulseaudio -k first if it complains about already being started, but since you say it doesn't work, it most probably is not running. Prefix sudo if it complains about permissions) should get you more detailed output on why PulseAudio won't start, which will enable you to find more specific info in your case.
If ...
1
I suppose Redis should fit the requirements. It's packaged in Debian and has several PHP client libraries of which one appears to be packaged, though only in Sid at the moment (but I suppose it should be trivial to backport).
1
Source the environment in your startup script if mugen kenichi's solution is not an option. I have some startup scripts that use mugen's approach and others that source the environment directly in the script. It's often simply a matter of preference. Sourcing the environment directly in the startup script is more transparent to other users who might edit the ...
1
If I understand the question correctly, when you're using sambad stop, it's referred by PID number as well, which is stored in /var/run/ directory (or other depending on your system). The file is created when you do start.
This feature is not built-into that deamon. If you edit /etc/rc.d/daemon-name, you could see it's a simple bash script, which running ...
1
Most of the functionality is not built into the daemon, but into the init scripts. In /etc/init.d/sambad there will be code to keep track of the PID when it's started and signal it when it needs to stop. The init scripts are usually more specific to the distribution than to the daemon in question since system startup and service administration is one of the ...
1
It looks like you might be able to redirect it to a tty.
StandardInput= Controls where file descriptor 0 (STDIN)
of the executed processes is connected to. Takes one of null, tty,
tty-force, tty-fail or socket. If null is selected standard input will
be connected to /dev/null, i.e. all read attempts by the process will
result in immediate EOF. If ...
1
No, it's not a waste. It is normal for separate programs to be running in separate processes, so that they couldn't (accidentally or intentionally) modify each other's state. Separate processes also mean that if one program crashes, all others are left unaffected.
1
Try doing this :
cd /etc/init
vim nginx*.conf
See mans :
init (5) - Upstart init daemon job configuration
init (7) - Upstart process management daemon
init (8) - Upstart process management daemon
I mean :
man 5 init; man 7 init; man 8 init
found with :
man -k init | grep -o '^init (\w)'
init (5)
init (7)
init ...
1
First list the service using chkconfig command
[root@localhost ~]# chkconfig --list | grep -i postgresql
postgresql-8.4 0:off 1:off 2:on 3:on 4:on 5:off 6:off
Suppose if you want to run postgresql automatically every time server is started
Then Try this command
[root@localhost ~]# chkconfig --level 5 postgresql-8.4 on
Here --level ...
1
Launchd doesn't just launch programs, it monitors them as they run. By default, it expects the programs to keep running (as daemons), not to start some other program (/background copy of themselves/whatever) and exit. If the program does exit, launchd does two things that can cause problems for a run-and-exit program like youtrack start: it'll "clean up" ...
Only top voted, non community-wiki answers of a minimum length are eligible
