[Arm-dev] Customizing Chronyd for no battery

Mon Apr 24 16:00:49 UTC 2017
Robert Moskowitz <rgm at htt-consult.com>


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.