aboutsummaryrefslogtreecommitdiffstats
path: root/src/daemon.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* daemon: disable daemonize_detach() on WIN32Max Kellermann2009-03-011-1/+3
|
* added G_LOG_DOMAIN macros to several librariesMax Kellermann2009-02-191-0/+3
| | | | | Define the GLib logging domain in the following libraries: conf, daemon, event_pipe, log.
* daemon: return early from daemonize_set_user()Max Kellermann2009-02-151-19/+20
| | | | | If no "user" is configured, return from daemonize_set_user(). Save one level of indent.
* daemon: ignore "user" setting if already running as that userMax Kellermann2009-02-151-3/+6
| | | | | | If mpd.conf specifies a user, and MPD is invoked by exactly this user, ignore the "user" setting. Don't bother to look up its groups and don't attempt to change uid, it won't work anyway.
* daemon: added comments to daemonize_detach()Max Kellermann2009-02-151-0/+9
|
* daemon: print fork error messageMax Kellermann2009-02-151-2/+3
| | | | Print details on why the fork() fails.
* daemon: moved code to daemonize_detach()Max Kellermann2009-02-151-19/+23
| | | | | Moved the code which detaches from the parent process/session to a separate function.
* daemon: removed unused variable "userpwd"Max Kellermann2009-01-181-8/+4
| | | | This causes a segmentation fault...
* daemon: pass "detach" flag to daemonize()Max Kellermann2009-01-181-3/+4
| | | | | This way, we don't have to pass the full "Options" object to daemonize().
* daemon: added daemonize_init(), daemonize_finish()Max Kellermann2009-01-181-38/+62
| | | | | | The constructor/destructor functions parse and free the configuration properly. This way, we don't have to load the pid file path more than once.
* main: moved code to daemon.cMax Kellermann2009-01-181-0/+97
| | | | | Moved changeToUser(), cleanUpPidFile(), killFromPidFile() to daemon.c. These are daemonization functions.
* conf: no CamelCase, part IMax Kellermann2009-01-171-1/+2
| | | | Renamed functions, types, variables.
* daemon: don't check the setsid() return valueMax Kellermann2009-01-131-3/+1
| | | | | There is only one valid error condition for setsid(): when the current process is already the process group leader. This is non-critical.
* daemon: don't fork twice to daemonizeMax Kellermann2009-01-131-8/+0
| | | | | To detach from the parent process, fork once and make the old process exit. No need to do that twice.
* daemon: simplified daemonize_close_stdin()Max Kellermann2008-12-301-16/+6
| | | | Don't bother to call fstat() or isatty() on STDIN_FILENO.
* listen: moved redirect_stdin() to daemon.cMax Kellermann2008-12-301-0/+26
| | | | | redirect_stdin() is a daemonization function, and disconnecting from the standard input is always a good idea for MPD.
* main: moved daemonize() to daemon.cMax Kellermann2008-12-301-0/+86