# start and stop a tree of services

## schorsch_76

Hi,

now as i got my two hostapds running [1] i want to solve the next issue. I have a USB device for a network card to work as the interface for the ppp daemon. I set up openrc 

```

rc_hotplug="*"

rc_stop_crashed_services="Yes"

rc_start_crashed_services="YES"

```

in /etc/udev/rules/70-persistent-net.rules i did a RUN+="/etc/init.d/net.ppp0 start" and  RUN+="/etc/init.d/net.ppp0 stop" at the add/remove action lines of my eth3 device.

My final goal is, that the shorewall, ppp0, dnsmasq and co start and stop if i attach my devices. 

For example the net.eth3 service starts and stops, but it doesn't start my net.ppp0 service from the eudev rule. From the wiki [2][3] i dont get much info what i can do now. I know, if i do a manual "rc", after attaching the usb device, it starts the services like they are define in runlevel "default". 

@skarnet: Could i solve this with s6? Can s6 stop and start a tree of services, if for example, net.eth3 goes away where shorewall/net.ppp0/dnsmasq and others rely on?

[1] https://forums.gentoo.org/viewtopic-t-994626.html

[2] http://wiki.gentoo.org/wiki/OpenRC

[3] http://wiki.gentoo.org/wiki/Iphone_USB_Tethering#udev_trigger

----------

## khayyam

schorsch_76 ...

You can create a (stacked) runlevel with these services and have udev run this on card insertion. See this post for an example.

best ... khay

----------

## schorsch_76

Thanks! i will take a look at it!

----------

## khayyam

 *schorsch_76 wrote:*   

> Thanks! i will take a look at it!

 

schorsch_76 ... you're welcome ... ask if you have any problems or questions.

best ... khay

----------

