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 778D91381F1 for ; Mon, 6 Jun 2016 22:59:55 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 11A7625402B; Mon, 6 Jun 2016 22:59:47 +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 D29B721C012 for ; Mon, 6 Jun 2016 22:59:45 +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 7D2D5340CC9 for ; Mon, 6 Jun 2016 22:59:44 +0000 (UTC) Subject: Re: [gentoo-user] Safe systemd "reload" command To: gentoo-user@lists.gentoo.org References: <57535ABD.3010005@gentoo.org> From: Michael Orlitzky X-Enigmail-Draft-Status: N1110 Message-ID: <5756005B.1090302@gentoo.org> Date: Mon, 6 Jun 2016 18:59:39 -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: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Archives-Salt: 2d316361-8de2-46ff-89b3-09213aa68973 X-Archives-Hash: 05baf83af533a7e9be4d0d500016a5c2 On 06/06/2016 06:04 PM, Tom H wrote: > > 1) I've never used systemd on Gentoo but I assume that you can > co-install openrc and systemd. So you'd want to check whether systemd > is running: > > [ -d /run/systemd/system ] > I think the way I did this, it will be a no-op if systemd is not running (or if e.g. spamd is not running *under* systemd). I committed the cron job yesterday, so I'll hear about it if it doesn't work. > 2) spamassassin.service is running > 3) reload or restart spamassassin.service > > systemctl try-reload-or-restart spamassassin.service > if sa is running, it'll reload it if sa supports a reload, otherwise > it'll restart it > Ah, that sounds like an improvement. It looks like amavisd.service supports reloading, but spamd.service doesn't. The way we do it in spamd.init is to send a HUP signal to the spamd process (determined from its PID file). Google tells me that ExecReload=/bin/kill -HUP $MAINPID should work...