[Arm-dev] Final - Re: Customizing Chronyd for no battery

Robert Moskowitz rgm at htt-consult.com
Mon Apr 24 16:22:01 UTC 2017


I hope!  :)

On 04/24/2017 06:00 PM, Robert Moskowitz wrote:
>
>
> On 04/24/2017 04:53 PM, Jim Perrin wrote:
>>
>> On 04/23/2017 11:21 AM, Robert Moskowitz wrote:
>>
>>>> Can you point me to instructions?  I looked at
>>>>
>>>> /etc/systemd/system/multi-user.target.wants/postfix.service
>>>>
>> The easy way is 'systemctl edit postfix'
>> This will create appropriate file in
>> /etc/systemd/system/postfix.d/override.conf. (or something like that)
>> and you can go from there. Once you're sure exactly where the file will
>> be then you can mess with it some more.
>>
>>
>>
>>>> And the change I made to /usr/lib/systemd/system/postfix.service
>>>> carried over, and the timestamp in /etc/systemd did not change. 
>>>> Strange.
>>
>> If you didn't systemctl daemon-reload, then that would be why.
>
> Now I see why...
>
> The contents of /etc/systemd/system/multi-user.target.wants
>
> is just sym links to files in /usr/lib/systemd/system
>
> Change the default in /usr, nat it changes the what is seen in 
> /etc/systemd....
>
> Just about got the command written...
>
> mkdir /etc/systemd/system/postfix.service.d
> sed -n '/^After=/ s/$/ time-sync.target/p' 
> /usr/lib/systemd/system/postfix.service >> 
> /etc/systemd/system/postfix.service.d/override.conf
>
> I made it an append (>>)  in case there is an existing override.conf.
>
> Further refinement for the howto will be to use an environment 
> variable of service=postfix so that if the reader wants to also do 
> samba and httpd, it is easier to change the content of the variable 
> than both the above lines...
>
> thanks for pointing me in a 'better' direction on this one.

systemctl enable chrony-wait
systemctl start chrony-wait
service=postfix
mkdir /etc/systemd/system/$service.service.d
cat <<EOF>>/etc/systemd/system/$service.service.d/override.conf || exit 1
[Unit]
EOF
sed -n '/^After=/ s/$/ time-sync.target/p' 
/usr/lib/systemd/system/$service.service >> 
/etc/systemd/system/$service.service.d/override.conf

Problem with this may occur if there is already an override.conf file 
with a [Unit] section.  Likelihood is very low.

Thanks for all the help



More information about the Arm-dev mailing list