Skip to content

Commit cfe915e

Browse files
committed
Reclassify sysv, more like service than run/task
Signed-off-by: Joachim Wiberg <[email protected]>
1 parent ecf65ce commit cfe915e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/service.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2006,7 +2006,7 @@ void service_monitor(pid_t lost, int status)
20062006
kill(-svc->pid, SIGKILL);
20072007

20082008
/* Try removing PID file (in case service does not clean up after itself) */
2009-
if (svc_is_daemon(svc) || svc_is_tty(svc)) {
2009+
if (svc_is_daemon(svc) || svc_is_sysv(svc) || svc_is_tty(svc)) {
20102010
service_cleanup(svc);
20112011
} else if (svc_is_runtask(svc)) {
20122012
/* run/task should run at least once per runlevel */
@@ -2396,7 +2396,7 @@ static void svc_set_state(svc_t *svc, svc_state_t new_state)
23962396
}
23972397
}
23982398

2399-
if (svc_is_daemon(svc)) {
2399+
if (svc_is_daemon(svc) || svc_is_sysv(svc)) {
24002400
char cond[MAX_COND_LEN];
24012401

24022402
snprintf(cond, sizeof(cond), "service/%s/", svc_ident(svc, NULL, 0));
@@ -2653,7 +2653,7 @@ int service_step(svc_t *svc)
26532653
break;
26542654
}
26552655

2656-
if (svc_is_runtask(svc)) { /* only run/task, not sysv here */
2656+
if (svc_is_runtask(svc)) {
26572657
svc_set_state(svc, SVC_STOPPING_STATE);
26582658
svc->restart_tot++;
26592659
svc->once++;

src/sm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ void sm_step(sm_t *sm)
201201
switch (sm->state) {
202202
case SM_BOOTSTRAP_STATE:
203203
dbg("Bootstrapping all services in runlevel S from %s", finit_conf);
204-
service_step_all(SVC_TYPE_RUNTASK | SVC_TYPE_SERVICE);
204+
service_step_all(SVC_TYPE_RUNTASK | SVC_TYPE_SERVICE | SVC_TYPE_SYSV);
205205

206206
sm->state = SM_BOOTSTRAP_WAIT_STATE;
207207
break;

src/svc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ typedef enum {
5252
} svc_type_t;
5353

5454
#define SVC_TYPE_ANY (-1)
55-
#define SVC_TYPE_RESPAWN (SVC_TYPE_SERVICE | SVC_TYPE_TTY)
56-
#define SVC_TYPE_RUNTASK (SVC_TYPE_RUN | SVC_TYPE_TASK | SVC_TYPE_SYSV)
55+
#define SVC_TYPE_RESPAWN (SVC_TYPE_SERVICE | SVC_TYPE_SYSV | SVC_TYPE_TTY)
56+
#define SVC_TYPE_RUNTASK (SVC_TYPE_RUN | SVC_TYPE_TASK)
5757

5858
typedef enum {
5959
SVC_HALTED_STATE = 0, /* Not allowed in runlevel, or not enabled. */

0 commit comments

Comments
 (0)