__rc_service_daemon_set is now a private function
This commit is contained in:
parent
379b66936c
commit
daf868394f
@ -148,7 +148,7 @@ pid_t *rc_find_pids (const char *exec, const char *cmd,
|
|||||||
librc_hidden_def(rc_find_pids)
|
librc_hidden_def(rc_find_pids)
|
||||||
|
|
||||||
#elif defined(__DragonFly__) || defined(__FreeBSD__) || \
|
#elif defined(__DragonFly__) || defined(__FreeBSD__) || \
|
||||||
defined(__NetBSD__) || defined(__OpenBSD__)
|
defined(__NetBSD__) || defined(__OpenBSD__)
|
||||||
|
|
||||||
# if defined(__DragonFly__) || defined(__FreeBSD__)
|
# if defined(__DragonFly__) || defined(__FreeBSD__)
|
||||||
# ifndef KERN_PROC_PROC
|
# ifndef KERN_PROC_PROC
|
||||||
@ -283,9 +283,9 @@ static bool _match_daemon (const char *path, const char *file,
|
|||||||
return (m == 111 ? true : false);
|
return (m == 111 ? true : false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void rc_service_daemon_set (const char *service, const char *exec,
|
void __rc_service_daemon_set (const char *service, const char *exec,
|
||||||
const char *name, const char *pidfile,
|
const char *name, const char *pidfile,
|
||||||
bool started)
|
bool started)
|
||||||
{
|
{
|
||||||
char *svc = rc_xstrdup (service);
|
char *svc = rc_xstrdup (service);
|
||||||
char *dirpath = rc_strcatpaths (RC_SVCDIR, "daemons", basename (svc),
|
char *dirpath = rc_strcatpaths (RC_SVCDIR, "daemons", basename (svc),
|
||||||
@ -368,7 +368,7 @@ void rc_service_daemon_set (const char *service, const char *exec,
|
|||||||
free (mpidfile);
|
free (mpidfile);
|
||||||
free (dirpath);
|
free (dirpath);
|
||||||
}
|
}
|
||||||
librc_hidden_def(rc_service_daemon_set)
|
librc_hidden_def(__rc_service_daemon_set)
|
||||||
|
|
||||||
bool rc_service_started_daemon (const char *service, const char *exec,
|
bool rc_service_started_daemon (const char *service, const char *exec,
|
||||||
int indx)
|
int indx)
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
#include <kvm.h>
|
#include <kvm.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "librc-daemon.h"
|
||||||
#include "librc-depend.h"
|
#include "librc-depend.h"
|
||||||
#include "rc.h"
|
#include "rc.h"
|
||||||
#include "rc-misc.h"
|
#include "rc-misc.h"
|
||||||
@ -79,7 +80,6 @@ librc_hidden_proto(rc_runlevel_starting)
|
|||||||
librc_hidden_proto(rc_runlevel_stopping)
|
librc_hidden_proto(rc_runlevel_stopping)
|
||||||
librc_hidden_proto(rc_service_add)
|
librc_hidden_proto(rc_service_add)
|
||||||
librc_hidden_proto(rc_service_daemons_crashed)
|
librc_hidden_proto(rc_service_daemons_crashed)
|
||||||
librc_hidden_proto(rc_service_daemon_set)
|
|
||||||
librc_hidden_proto(rc_service_delete)
|
librc_hidden_proto(rc_service_delete)
|
||||||
librc_hidden_proto(rc_service_description)
|
librc_hidden_proto(rc_service_description)
|
||||||
librc_hidden_proto(rc_service_exists)
|
librc_hidden_proto(rc_service_exists)
|
||||||
@ -116,4 +116,6 @@ librc_hidden_proto(rc_xmalloc)
|
|||||||
librc_hidden_proto(rc_xrealloc)
|
librc_hidden_proto(rc_xrealloc)
|
||||||
librc_hidden_proto(rc_xstrdup)
|
librc_hidden_proto(rc_xstrdup)
|
||||||
|
|
||||||
|
librc_hidden_proto(__rc_service_daemon_set)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
10
src/rc.h
10
src/rc.h
@ -93,16 +93,6 @@ bool rc_service_add (const char *runlevel, const char *service);
|
|||||||
* @return true if sucessful, otherwise false */
|
* @return true if sucessful, otherwise false */
|
||||||
bool rc_service_delete (const char *runlevel, const char *service);
|
bool rc_service_delete (const char *runlevel, const char *service);
|
||||||
|
|
||||||
/*! Save the arguments to find a running daemon
|
|
||||||
* @param service to save arguments for
|
|
||||||
* @param exec that we started
|
|
||||||
* @param name of the process (optional)
|
|
||||||
* @param pidfile of the process (optional)
|
|
||||||
* @param started if true, add the arguments otherwise remove existing matching arguments */
|
|
||||||
void rc_service_daemon_set (const char *service, const char *exec,
|
|
||||||
const char *name, const char *pidfile,
|
|
||||||
bool started);
|
|
||||||
|
|
||||||
/*! Returns a description of what the service and/or option does.
|
/*! Returns a description of what the service and/or option does.
|
||||||
* @param service to check
|
* @param service to check
|
||||||
* @param option to check (if NULL, service description)
|
* @param option to check (if NULL, service description)
|
||||||
|
@ -29,7 +29,6 @@ global:
|
|||||||
rc_runlevel_stopping;
|
rc_runlevel_stopping;
|
||||||
rc_service_add;
|
rc_service_add;
|
||||||
rc_service_daemons_crashed;
|
rc_service_daemons_crashed;
|
||||||
rc_service_daemon_set;
|
|
||||||
rc_service_delete;
|
rc_service_delete;
|
||||||
rc_service_description;
|
rc_service_description;
|
||||||
rc_service_exists;
|
rc_service_exists;
|
||||||
@ -69,3 +68,7 @@ global:
|
|||||||
local:
|
local:
|
||||||
*;
|
*;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
RC_PRIVATE {
|
||||||
|
__rc_service_daemon_set;
|
||||||
|
};
|
||||||
|
@ -46,6 +46,7 @@ static struct pam_conv conv = { NULL, NULL} ;
|
|||||||
|
|
||||||
#include "builtins.h"
|
#include "builtins.h"
|
||||||
#include "einfo.h"
|
#include "einfo.h"
|
||||||
|
#include "librc-daemon.h"
|
||||||
#include "rc.h"
|
#include "rc.h"
|
||||||
#include "rc-misc.h"
|
#include "rc-misc.h"
|
||||||
#include "strlist.h"
|
#include "strlist.h"
|
||||||
@ -758,7 +759,7 @@ int start_stop_daemon (int argc, char **argv)
|
|||||||
unlink (pidfile);
|
unlink (pidfile);
|
||||||
|
|
||||||
if (svcname)
|
if (svcname)
|
||||||
rc_service_daemon_set (svcname, exec, cmd, pidfile, false);
|
__rc_service_daemon_set (svcname, exec, cmd, pidfile, false);
|
||||||
|
|
||||||
exit (EXIT_SUCCESS);
|
exit (EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
@ -1032,7 +1033,7 @@ int start_stop_daemon (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (svcname)
|
if (svcname)
|
||||||
rc_service_daemon_set (svcname, exec, cmd, pidfile, true);
|
__rc_service_daemon_set (svcname, exec, cmd, pidfile, true);
|
||||||
|
|
||||||
exit (EXIT_SUCCESS);
|
exit (EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user