From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id C0A6F13829C for ; Sun, 5 Jun 2016 13:37:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0FBEF254047; Sun, 5 Jun 2016 13:37:46 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C38D625402F for ; Sun, 5 Jun 2016 13:37:44 +0000 (UTC) Received: from [192.168.1.100] (c-98-218-46-55.hsd1.md.comcast.net [98.218.46.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mjo) by smtp.gentoo.org (Postfix) with ESMTPSA id E5D6B340821 for ; Sun, 5 Jun 2016 13:37:43 +0000 (UTC) Subject: Re: [gentoo-user] Safe systemd "reload" command To: gentoo-user@lists.gentoo.org References: <57535ABD.3010005@gentoo.org> <5753769C.3020404@gentoo.org> <575379E4.9060506@gentoo.org> <1465111405.5349.53.camel@gmail.com> From: Michael Orlitzky X-Enigmail-Draft-Status: N1110 Message-ID: <57542B1D.70103@gentoo.org> Date: Sun, 5 Jun 2016 09:37:33 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 In-Reply-To: <1465111405.5349.53.camel@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: 398a12a8-b8cc-4661-9c7d-9015011e3e19 X-Archives-Hash: 7e38497514559923e0be91b948ac68ae On 06/05/2016 03:23 AM, J. GarcĂ­a wrote: > I run systemd , but I have not tested your script, as of now I'm not > using spamassassin, but I will at some time in near future; but looking > at the script, I see some problems, you run the OpenRC restart commands > even if systemd is available, further it doesn't know which one is > running, as both can be installed(And are installed if using systemd), That's what the "/etc/init.d/spamd status" command is meant to check. The "... status" will only return success if you are running spamd via openrc. Likewise, as I understand it (but haven't tested), the "systemctl try-restart spamassassin" command will only work if you are *using* systemd and the spamassassin service is running. They should be harmless otherwise. For example... # spamd --daemonize # /etc/init.d/spamd status * status: stopped # echo $? 3 If on the first line I had done "systemctl start spamassassin.service", I should get the same result, so the openrc reload commands will be skipped for systemd users. I did take your suggestion and check for rc-service though. I shouldn't count on openrc being in @system forever.