On Fri, May 1, 2015 at 3:56 PM, Yamaban
On Fri, 1 May 2015 21:49, Andrei Borzenkov wrote:
On Fri, 1 May 2015 19:57:52 +0200 Jan Engelhardt wrote:
On Friday 2015-05-01 19:42, Greg Freemyer wrote:
It has a service file that is designed to be installed immediately via zypper and then manually edited. That works until you re-install the package, at which point it replaces my edits with the virgin service file.
Your edits belong into /etc/systemd/system/autossh.service.d/my.conf
[Service] ExecStart=newcommandline
It probably should be
ExecStart= ExecStart=new command line
otherwise it will be added in addition to existing command line.
…do _not_ edit /usr/lib/systemd/ manually ;-)
Question: Could the autossh package contain this file: "/etc/systemd/system/autossh.service.d/my.conf" with the content: [code]
[Service] ExecStart= ExecStart=new valid autossh command line here
[/code]
and have the relevant notice made in the man-page?
That way the idea to edit the main service file would be much better supressed than otherwise.
Thanks for the consideration. - Yamaban.
I don't maintain autossh, but I will create a SR to clean this up if you guys can guide me to the best approach. On my own I would edit the /usr/lib/systemd service file to have: ========== # DO NOT EDIT THIS FILE, # use /etc/systemd/system/autossh.service.d/my.conf to override this file instead [Unit] Description=AutoSSH service for port 2222 After=network.target [Service] Environment="AUTOSSH_GATETIME=0" ExecStart=echo "The file /etc/systemd/system/autossh.service.d/my.conf MUST be edited to override this assignment.". [Install] WantedBy=multi-user.target # DO NOT EDIT THIS FILE =========== Then I would add a sample/template file to /etc/systemd/system/autossh.service.d/my.conf It would have content: ======================= # Override and reset the Description to blank Description= # Then append my local description to the blank Description Description=AutoSSH service for ssh reverse tunnel # Override and reset ExecStart to blank ExecStart= # Append a legal command to create a normal encrypted tunnel # ExecStart=/usr/bin/autossh -M 0 -NL 2222:localhost:2222 -o TCPKeepAlive=yes foo@bar.com # OR # Append a legal command to create a reverse encrypted tunnel # ExecStart=/usr/bin/autossh -M 0 -NR 2222:localhost:2222 -o TCPKeepAlive=yes foo@bar.com ======================= Let me know if there is a preferred or "openSUSE" approach to do this. Thanks Greg -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org