Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Aug 2020 04:36:20 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 248865] rc script in /usr/local/etc/rc.d/ may be ignored
Message-ID:  <bug-248865-227-a9GTMBKtsf@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-248865-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-248865-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | previous in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248865

--- Comment #1 from unitrunker@gmail.com ---
To reproduce, paste the following into a file named /usr/local/etc/rc.d/placebo

------------>8 snip 8<---------
#!/bin/sh

. /etc/rc.subr

name=placebo
rcvar=placebo_enable
start_cmd="${name}_start"
stop_cmd="${name}_stop"

placebo_start()
{
  sleep 5
}

placebo_stop()
{
  sleep 5
}

load_rc_config $name
run_rc_command "$1"
------------>8 snip 8<---------

Enable the service in /etc/rc.conf ...

# sysrc placebo="YES"

Verify the service runs ...

# service placebo start
# service placebo stop

... now reboot.

# reboot

The above service is NOT run by /etc/rc because it does not contain a '#
PROVIDE: ' clause.

-- 
You are receiving this mail because:
You are the assignee for the bug.

help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-248865-227-a9GTMBKtsf>