jeffk l33t
Joined: 13 Sep 2003 Posts: 671
|
Posted: Mon Aug 06, 2018 9:54 pm Post subject: OpenRC API to depend on a service if substring matches $CONF |
|
|
I am using net-misc/connman with net-wireless/iwd, works great for me. I have modified /etc/init.d/connman to conditionally need iwd based on a string test of CONNMAN_OPTS, and this is working well.
Code: | depend() {
need dbus
if [[ ${CONNMAN_OPTS} = *"iwd_agent"* ]]; then
need iwd
fi
provide net
}
start() {
ebegin "Starting Connection Manager"
start-stop-daemon --start --quiet --exec /usr/sbin/connmand -- ${CONNMAN_OPTS}
eend $?
} |
Question: is there a more idiomatic way to do this in OpenRC init scripts?
Also, I would like to stop both iwd and connman-vpnd when connman is stopped (currently connman-vpnd does not), still checking on iwd. What is the normal way to stop exclusively dependent services? Or is doing so a brittle method, and runlevels should be used instead?
Thanks |
|