Date: Wed, 28 Oct 1998 10:38:29 -0800 From: Graeme Tait <graeme@echidna.com> To: "Foster, Jim" <JFOSTER@cskauto.com> Cc: "'freebsd-questions@FreeBSD.ORG'" <freebsd-questions@FreeBSD.ORG> Subject: Re: Killing (HUP) the pppd process Message-ID: <363764A5.3841@echidna.com> References: <BF4A830F5207D2119420006008A1DB147F086C@v128041.vandenberg.af.mil>
next in thread | previous in thread | raw e-mail | index | archive | help
Foster, Jim wrote: > > Hi all; > > I have a small network at home and I am using FreeBSD as a server that > handles dialing out to my ISP. > > While this works fine, I am looking for a way of hanging up the modem before > the idle time expires when someone is done using the 'net. Since this is my > only phone line, it is not acceptable to just let it time-out. > > I found that I can issue 'kill -hup `cat /var/run/ppp0.pid`' (from memory, > may not be accurate) from root and it will hang up the modem. > > I figured that I could put the kill statement into a file, mark it as > executable, and turn on the set-owner-id for the file so it executes as > root. But, when a non-root user runs the script, kill tells them that it > will not do it because they are not the owner. I turned on the set-owner-id > on the owner first, and then both the owner and the group, but no > difference. And yes, the owner and group of the script are root and wheel. > > Since kill does not seem to work in this case, is there a better way of > getting the same job done? I use pppctl with user ppp. You can define a password that you can give to your users (presumably reasonably trustworthy), and they can then run pppctl to shut ppp down (and control ppp in general) from a network connection, without root privileges being required. There are many other possibilities - see man pppctl . > Finally, even to make this work the user needs to telnet to the box, > sign-on, and run the script. Is there some interface that someone knows > about that would run as a daemon and accept requests from a GUI interface to > do the same job? For instance, so they could run a M$ Windows app that > sends the hang-up request to the server? Assuming you are running Apache on the ppp machine (good fun anyway), you should be able to make a simple cgi script run by a http form submission (requiring user password authentication or some such thing) to send commands to pppctl. HTTP + CGI is a great way to get platform-independent support for such things. All the user needs is a web browser plus a network connection. -- Graeme Tait - Echidna To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?363764A5.3841>