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 A020513829C for ; Sun, 5 Jun 2016 00:19:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id ECBC1141F7; Sun, 5 Jun 2016 00:19:22 +0000 (UTC) Received: from mail-it0-f68.google.com (mail-it0-f68.google.com [209.85.214.68]) (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 D81FF141D5 for ; Sun, 5 Jun 2016 00:19:21 +0000 (UTC) Received: by mail-it0-f68.google.com with SMTP id k76so2788726ita.1 for ; Sat, 04 Jun 2016 17:19:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=rxiOFQGIOXxy6JyrxDlSFq6OjRtC9YBBTmaEIgECMiM=; b=Fy6quZOw5USYAdgpeEO0Ll3jGalBI7uL6BitFt/nIPIQTyt57Cg2QPcsBQiAMl++dD eiiYt8EUuaJNaPBK7jY3difsm5iaHhBlPDZTzsjAkft6Je/Eey1yd8mM3ghd9iBiSCWF SCEIGTPfl9JPqPl850Q56pR/mhZqq5HU46Ox8gzT2qZ/SqXFHXcuvtIrfsWAlmQupbH6 LJNifafyku6jVe4Lhq7uO58D/0aYjqUtrb8Y2cHBOcYm58RHHFl2pChx4EzTZYWHP0lK v42Rwco8P94QSe5SOPtpUzYh5dk2/iVQzMBvLxslp1YCUDGVxpWDcGR2XZk47gWdmr81 Zdug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=rxiOFQGIOXxy6JyrxDlSFq6OjRtC9YBBTmaEIgECMiM=; b=fagBrRMncnKwL6plaVlFCMWXO9oXg3Ia7BPs6rbpxM6lMvD6hiYtgKKrdkYowa1z6q 3TDqJFU99rk3nZs3K3nsuR9kqSoMzAft5pEujfNgW1IAC3tyfvnXeMMtJaig41dncbm5 PsExzykqcdbPCttcbTYwIw2t1XFq9sxkwFT2vJwTFqoWL8ursPGwmpVUw/2IPDxqVRJE tng3FvFrTbGRUDxOuWFdhn1XNSY9laFSF8Nt8vo6pQn8G7ha7da045o7ZPE0aja/zxFV ry0gAjyIyWiUv5R7DmNvQMqkPGOS1P4ohdNq388xlD9TfrBaX3fBafZGP1QycBkzuBmv nWHw== X-Gm-Message-State: ALyK8tLezzbc7Dj/6tDA+QVoSeQkMkatEK9ovUpAXA73EPRZbdrGlb+maCQf2B5l03lu0gNXw2nfYF9QE3ResA== X-Received: by 10.36.90.206 with SMTP id v197mr7740250ita.16.1465085961106; Sat, 04 Jun 2016 17:19:21 -0700 (PDT) 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 Sender: freemanrich@gmail.com Received: by 10.64.159.8 with HTTP; Sat, 4 Jun 2016 17:19:20 -0700 (PDT) In-Reply-To: <57535ABD.3010005@gentoo.org> References: <57535ABD.3010005@gentoo.org> From: Rich Freeman Date: Sat, 4 Jun 2016 20:19:20 -0400 X-Google-Sender-Auth: G4svCUfqAKY6F17-urzrhwCOOjc Message-ID: Subject: Re: [gentoo-user] Safe systemd "reload" command To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 X-Archives-Salt: 552f8a2c-4193-4128-b2b4-a476065c815b X-Archives-Hash: a3b7fdc145c974d6f7c753653898822a On Sat, Jun 4, 2016 at 6:48 PM, Michael Orlitzky wrote: > I'm planning on adding USE=cron to mail-filter/spamassassin to perform > nightly updates. I have a script that works for OpenRC, > > https://wiki.gentoo.org/wiki/SpamAssassin#Daily_updates > > but I've commented where I would like to have something similar for > systemd users. Anybody know how to do that? > > We can't count on systemd being installed, so we need to... > > 1. Test that systemd is installed. > > 2. Check if e.g. spamd is running (depends on #1 for the commands). > > 3. Reload or restart the daemon if #1 and #2 hold; or do nothing if > one of them doesn't. > Couldn't you just check for the existence of systemctl, and if it exists call "systemctl try-restart spamd". That will only work if systemd is running and spamd is running. I'm sure you can accomplish the same via dbus as well. -- Rich