Navigation

    Netgate Discussion Forum
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    PPPoE server forced restart [solved]

    General pfSense Questions
    4
    11
    9936
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      regis last edited by

      Hi all,

      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

      1 Reply Last reply Reply Quote 0
      • H
        hoba last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • R
          regis last edited by

          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…)

          1 Reply Last reply Reply Quote 0
          • H
            hoba last edited by

            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.

            1 Reply Last reply Reply Quote 0
            • R
              regis last edited by

              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  :'(

              1 Reply Last reply Reply Quote 0
              • D
                DanielSHaischt last edited by

                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

                Mit freundlichen Gruessen / With kind regards
                DAn.I.El S. Haischt

                1 Reply Last reply Reply Quote 0
                • R
                  regis last edited by

                  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

                  1 Reply Last reply Reply Quote 0
                  • D
                    DanielSHaischt last edited by

                    try```
                    killall -31 mpd

                    
                    Cheers
                    Daniel S. Haischt

                    Mit freundlichen Gruessen / With kind regards
                    DAn.I.El S. Haischt

                    1 Reply Last reply Reply Quote 0
                    • R
                      regis last edited by

                      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.

                      1 Reply Last reply Reply Quote 0
                      • A
                        aldo last edited by

                        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

                        1 Reply Last reply Reply Quote 0
                        • R
                          regis last edited by

                          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

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post