From owner-freebsd-questions Wed Oct 28 07:42:23 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA11979 for freebsd-questions-outgoing; Wed, 28 Oct 1998 07:42:23 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from hecate.webcom.com (hecate.webcom.com [209.1.28.39]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA11974 for ; Wed, 28 Oct 1998 07:42:22 -0800 (PST) (envelope-from graeme@echidna.com) Received: from eresh.webcom.com (eresh.webcom.com [209.1.28.49]) by hecate.webcom.com (8.9.1/8.9.1) with SMTP id HAA26788; Wed, 28 Oct 1998 07:41:43 -0800 Received: from [199.183.207.120] by inanna.webcom.com (WebCom SMTP 1.2.1) with SMTP id 19318949; Wed Oct 28 07:40 PST 1998 Message-Id: <363764A5.3841@echidna.com> Date: Wed, 28 Oct 1998 10:38:29 -0800 From: Graeme Tait Organization: Echidna X-Mailer: Mozilla 2.02 (Win16; I) Mime-Version: 1.0 To: "Foster, Jim" Cc: "'freebsd-questions@FreeBSD.ORG'" Subject: Re: Killing (HUP) the pppd process References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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