View previous topic :: View next topic |
Author |
Message |
schorsch_76 Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/12660649465602e3543dfd9.png)
Joined: 19 Jun 2012 Posts: 452
|
Posted: Wed Jul 09, 2014 5:48 am Post subject: start and stop a tree of services |
|
|
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
Code: |
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 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
khayyam Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/9397496074fd0189143bb7.png)
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Wed Jul 09, 2014 11:16 am Post subject: |
|
|
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 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
schorsch_76 Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/12660649465602e3543dfd9.png)
Joined: 19 Jun 2012 Posts: 452
|
Posted: Wed Jul 09, 2014 11:32 am Post subject: |
|
|
Thanks! i will take a look at it! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
khayyam Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/9397496074fd0189143bb7.png)
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Wed Jul 09, 2014 11:20 pm Post subject: |
|
|
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 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|