From owner-freebsd-questions@freebsd.org Thu Aug 8 06:58:42 2019 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1589C5795 for ; Thu, 8 Aug 2019 06:58:42 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 463zjs5jmCz3wky for ; Thu, 8 Aug 2019 06:58:41 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([94.222.20.73]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPA (Nemesis) id 1Mbkac-1iT1pJ21q2-00dGZI; Thu, 08 Aug 2019 08:52:23 +0200 Date: Thu, 8 Aug 2019 08:52:22 +0200 From: Polytropon To: Erich Dollansky Cc: hw , freebsd-questions@freebsd.org Subject: Re: howto allow anyone to poweroff? Message-Id: <20190808085222.77febec0.freebsd@edvax.de> In-Reply-To: <20190808094618.787a7422.freebsd.ed.lists@sumeritec.com> References: <20190807183735.f4a87306c851426be6b799ca@gc-24.de> <20190808094618.787a7422.freebsd.ed.lists@sumeritec.com> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:t/pvCZSvw78abGWwTPYm1ZKYdDLstYs4VATRDa6Tyjj2nkKzYrB Tt8NTTd39b22FqYdTyiTyciirBT5fB92K+RKIkoe6PKRmfkDEeiH5KEvM/qwjED01mm/ex6 mMG5ec3QtiTxaoV/MwknEtPQKmvqz3tcWkvbCR1TSpOAnkZnMxZ+l9wc//fFQUxAPBDq4tS jxJOJMWzpLsisirSYnBFA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:elWb4leifX4=:dltQ8FZ4In7xDG8NAvyUJx efmfp1NaStgYolZpn93GclQd4MbxdQdQBlp6Vio87PxDdHrGTFOqTRFtP1g94ekok8tBMwdPB K5dOb2qOtVKoQP5mX5Mf79lIbzITRKEuzpRFLFFD4Lhj9WWTOpqpgaEDb5DBE3JaORXs6cnW2 MnsJMbOs+gnSalDC9ONnb0J9jBjJqT/JF14vVvGaseCrPjoo9ta6+i2FQKXnvp3jgTir6+zfu C/Y3ZdrFiSQW1p3RH8Tt4SUoKAht4CueewUyIIQTxmxNGjTz/vQPEyhLe9oK+w5oDaA5u/hmp XB/XnX67f6UuXl+QbB4ctQvyMq7F58tEvKLYyKiPk+xZ8Zijh5oP+L+p2OLqtKULz/TbwRCzf 5/ZrUNGmYIKtgCZPFK6eGAm9++FNc6VgrmEZpJybSAElBU/WaCXVwuEXKFO6klC+Qqo3g2fQ8 bqBCdxVILABKsSBgW42m/vOeFpxt47PTTIwSpeBmgbcf08/wn06bGNkipdyXDN6uY34dfFMfn VGYn6y8Z8uNbpKoqheq4MthojPsxQ8pU9tJ9Il6obfNew5MwIJiM9K0gts22urAs6feMkgMuL V1lrMeHGpNM0v3/G/05c4f7BS7EyXypjmSrLRdhxZxTEfS9G7QjuMI+bW2iqFPIYdt0hCe7o/ BN6d0QGEERlsq0pSAMf37WWF4dAq2DCiKnh88Ax8eN4H76cOaEZd1BCoOoOacZWIx/z7ztt9h Svh4IohP7rr7NbmksOJG2EVEDsZENTzmz/MsMgIBqyhEpc59q4xDuCXWT+w= X-Rspamd-Queue-Id: 463zjs5jmCz3wky X-Spamd-Bar: ++++++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@edvax.de has no SPF policy when checking 212.227.126.134) smtp.mailfrom=freebsd@edvax.de X-Spamd-Result: default: False [6.44 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_ORG_HEADER(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[73.20.222.94.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_SPAM_SHORT(0.47)[0.472,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.98)[0.984,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.98)[0.984,0]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[134.126.227.212.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; IP_SCORE(0.60)[ip: (2.07), ipnet: 212.227.0.0/16(-1.37), asn: 8560(2.28), country: DE(-0.01)] X-Spam: Yes X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Aug 2019 06:58:42 -0000 On Thu, 8 Aug 2019 09:46:18 +0800, Erich Dollansky wrote: > Hi, > > On Wed, 7 Aug 2019 18:37:35 +0200 > hw wrote: > > > Hi, > > > > is there a way to allow ordinary users to poweroff a machine? I'd > > like to automatically poweroff PXE booted clients once the user that > > was logged in logs out after using it. > > an unconventional way would be to have a cron job checking if someone > is locked in an power off the machine if none is logged in. You do not > have problems with the access rights but might run into the problem > that the machine shutsdown when somebody just has arrived at the > machine. > > You also can catch the logout event and shut the machine down then. It > is the problem with the access right again. TO extend this idea, you could parse the output of programs like "w" to check for reamining interactive users. If the last one has logged out in a cron-controlled specific time window, the system could perform a shutdown. Hoewever, the problem described above will remain. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...