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 18FBA13829C for ; Tue, 7 Jun 2016 10:17:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 11C7A141C9; Tue, 7 Jun 2016 10:17:17 +0000 (UTC) Received: from mail-it0-f54.google.com (mail-it0-f54.google.com [209.85.214.54]) (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 D302921C028 for ; Tue, 7 Jun 2016 10:17:15 +0000 (UTC) Received: by mail-it0-f54.google.com with SMTP id h190so2401728ith.1 for ; Tue, 07 Jun 2016 03:17:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=a5mBeME38hl+MYh/TrmCdJC2+aX1tsAGdsLjyluTolM=; b=L2yaiVOA9IxTzFuwkbXyzNYyNIDEtWmM5+pgXaiA1AnXrdJxoCTDhGEembxAm1b2kn 1T5ryjjNZjwKZtzFeb7e8KeIbdeY2z0D7J797BNzZtDeD5B+mgdI/N3JZY44CguybERD kaTlFQeijAxCiOJpqJM7vPcL6mhclzUP6xfzg3xfMwug5yiO1OXWoT/ZWvpR/YLcgstg 7aEwCjcajkF+7wzKQnuZZVN8GYRdE3yTce40XvCcfyTiyrEZFD5Mqg8/Mb0wICARcfF1 XkkaY0lHPX3xjpPR0lehc6wc95rgR/rtRWNUWKE/wdZ7tDbmElbTo1PG5lIqtdHqHClG K5zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=a5mBeME38hl+MYh/TrmCdJC2+aX1tsAGdsLjyluTolM=; b=dJ2lKbBoXnRAQi3GmlyEb0rrZ7IEBSTdKJ0yI2Hj/XssCc98WJkh0kriZO+vN/rgFH Eyyj5cTTw6zu/5d/278/KDB4qZ+O8befbTfZaZ91FT4P0H6VlssOChz+2GsTm1Rb6My4 M2t5ksx5bCeeodOS/VrlY2La+102/hT14tgcsAnFWS0S/TNQsLB7cFunaYvzkMPDzRxD iWpfcHllZEVPfjsczGRYluMJOxCUJxhbDL3WLVDGV7zx7oN0Ds3uscvf/lCA3eJaCapv 4i3euyqnR4ENln03HsSMDZbHw8GZO4B2YRGrWfRcozcxxODRojbGjb7okQMbS7w50VQm YiKg== X-Gm-Message-State: ALyK8tKdusyEJd3IND1ukbBsklSU4uiNzdn3c1whwoQekNvxVFIdzZaPFsMvWfmGhMMnNI5yC7GyaVMlwDeYIQ== X-Received: by 10.36.23.129 with SMTP id 123mr2308812ith.26.1465294634997; Tue, 07 Jun 2016 03:17:14 -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 Received: by 10.79.34.69 with HTTP; Tue, 7 Jun 2016 03:17:14 -0700 (PDT) In-Reply-To: <5756005B.1090302@gentoo.org> References: <57535ABD.3010005@gentoo.org> <5756005B.1090302@gentoo.org> From: Tom H Date: Tue, 7 Jun 2016 12:17:14 +0200 Message-ID: Subject: Re: [gentoo-user] Safe systemd "reload" command To: Gentoo User Content-Type: text/plain; charset=UTF-8 X-Archives-Salt: 1414d1da-418c-473d-a805-a9c1f38b7479 X-Archives-Hash: 38e066b3cdc8ccd4104eba8ede4cf2c5 On Tue, Jun 7, 2016 at 12:59 AM, Michael Orlitzky wrote: > 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. I've just looked at your script. Do systemctl try-restart spamassassin and systemctl try-restart amavisd need "2>/dev/null" if you're booted with sysvinit+openrc but have systemd installed like the rc-service invocations in the opposite case? or do they fail silently? >> 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... It's the canonical way.