PPPoE server forced restart [solved]
I have a pfSense with PPPoE server and Freeradius authentication that's working like a charm.
now i would like to force disconnection of the users once a day (at midnight for example)
if i issue a killall -15 mpd from the shell, the users gets disconnected and radius accounting is up to date so everything's ok
but how to restart the mpd daemon ? which command sould i execute in cron to restart mpd properly ?
thanks for your help
Search for scheduled pppoe client reconnects. This has been asked before. Also have a look at the newer snapshots and their wan pppoe scheduled disconnect feature. This should give you some hints. You even now can add cron items to the config.xml in the latest snapshots. Enable wan at pppoe with reconnect time and have a look at what gets written to the config.xml.
thanks for your hints Hoba
i found a topic where you answered how to accomplish that with pppoe client (didn't found it yesterday) :
- 4 * * * root killall mpd && /usr/local/sbin/mpd -b -d /var/etc/ -p /var/run/mpd.pid pppoe
but it doesn't work with pppoe server because the mpd.conf doesn't exists
how to adapt this for pppoe server ? (i'm not very familiar with all these processes parameters…)
I guess you have to inspect the pppoe server settings page to see what happens on saving. It restarts the service to apply the new config. You should be able to use the exact same command to restart it.
i edited the vpn_pppoe.php page but i'm not a programmer and i'm not able to see what happens when i hit the save button on this page :'(
why don't you create a crontab entry that exactly does what you were doing on the command line? i.e.```
killall -15 mpd
Cheers Daniel S. Haischt
because this command stops the mpd daemon but doesn't restart it !
my problem atm is to find the command to restart the pppoe server
killall -31 mpd
Cheers Daniel S. Haischt
i tried a killall -31 mpd but nothing happens except this message in system log :
mpd: mpd: rec'd signal usr2, ignored
in the meantime, i found the command used to launch the daemon :
/usr/local/sbin/mpd -b -d /var/etc/mpd-vpn -p /var/run/mpd-vpn.pid pppoe
so i'll try a crontab like
0 0 * * * root killall -15 mpd && /usr/local/sbin/mpd -b -d /var/etc/mpd-vpn -p /var/run/mpd-vpn.pid pppoe
and see if it works like expected.
i was playing with this the other day
if you stop pppoe server with mpd -k -d /var/etc/mpd-vpn -p /var/run/mpd-vpn.pid pppoe
then start it with mpd -b -d /var/etc/mpd-vpn -p /var/run/mpd-vpn.pid pppoe
and all works fine
check the mpd –help to see the kill command
thanks for your suggestion Aldo
finally i've put this in a script called pppoesrvrestart :
killall -15 mpd && sleep 2 && /usr/local/sbin/mpd -b -d /var/etc/mpd-vpn -p /var/run/mpd-vpn.pid pppoe
and then added that in config.xml :
<minute>0</minute> <hour>0</hour> <mday>*</mday> <month>*</month> <wday>*</wday> <who>root</who> <command></command>/etc/pppoesrvrestart
and pppoe server is restarting everyday at midnight
thanks all for your help