[DRE-maint] Bug#890399: gitlab: override.conf in /etc/systemd/system/gitlab-*.service.d is not overwriten
Here is little patch to migrate from override.conf to gitlab-user.conf in postinst. Feel free to use or modify or discard ;) Libor diff -ur a/debian/postinst b/debian/postinst --- a/debian/postinst 2018-02-14 12:52:35.904334762 +0100 +++ b/debian/postinst 2018-02-14 12:58:49.583882426 +0100 @@ -268,11 +268,15 @@ path=/etc/systemd/system/gitlab-${service}.service.d mkdir -p $path if [ -e $path/override.conf ]; then - echo "$path/override.conf already exist" + # Disable user in override.conf + sed -i "s/^\( *\)\(User=.*\)/\1#\2/" $path/override.conf +fi +if [ -e $path/gitlab-user.conf ]; then + echo "$path/gitlab-user.conf already exist" # Make sure only gitlab user is updated - sed -i "s/^ *User=.*/User=$gitlab_user/" $path/override.conf + sed -i "s/^ *User=.*/User=$gitlab_user/" $path/gitlab-user.conf else - printf "[Service]\nUser=${gitlab_user}\n" > $path/override.conf + printf "[Service]\nUser=${gitlab_user}\n" > $path/gitlab-user.conf fi done ___ Pkg-ruby-extras-maintainers mailing list Pkg-ruby-extras-maintainers@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ruby-extras-maintainers
[DRE-maint] Bug#890399: gitlab: override.conf in /etc/systemd/system/gitlab-*.service.d is not overwriten
Here is little patch to migrate from override.conf to gitlab-user.conf in postinst. Feel free to use or modify or discard ;) Libor diff -ur a/debian/postinst b/debian/postinst --- a/debian/postinst 2018-02-14 12:52:35.904334762 +0100 +++ b/debian/postinst 2018-02-14 12:58:49.583882426 +0100 @@ -268,11 +268,15 @@ path=/etc/systemd/system/gitlab-${service}.service.d mkdir -p $path if [ -e $path/override.conf ]; then - echo "$path/override.conf already exist" + # Disable user in override.conf + sed -i "s/^\( *\)\(User=.*\)/\1#\2/" $path/override.conf +fi +if [ -e $path/gitlab-user.conf ]; then + echo "$path/gitlab-user.conf already exist" # Make sure only gitlab user is updated - sed -i "s/^ *User=.*/User=$gitlab_user/" $path/override.conf + sed -i "s/^ *User=.*/User=$gitlab_user/" $path/gitlab-user.conf else - printf "[Service]\nUser=${gitlab_user}\n" > $path/override.conf + printf "[Service]\nUser=${gitlab_user}\n" > $path/gitlab-user.conf fi done ___ Pkg-ruby-extras-maintainers mailing list Pkg-ruby-extras-maintainers@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ruby-extras-maintainers
[DRE-maint] Bug#890399: gitlab: override.conf in /etc/systemd/system/gitlab-*.service.d is not overwriten
Package: gitlab Version: 9.5.4.+dfsg-2 Severity: normal -BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hello, another problem. If admin creates for example: /etc/systemd/system/gitlab-sidekiq.service.d/override.conf by hand, changing properties other than User, then postinst script fails to update User property. My file is #[Service] #Restart=always so no User to change by sed inside postinst. I don't know if some debian policy on naming such override files exists, but can you use for example gitlab(-user).conf ? It is also parsed and included by systemd. Also systemd doesn't like EnvironmentFile=-/etc/default/gitlab in /lib/systemd/system/gitlab-unicorn.service service doesn't start because of Feb 14 12:35:41 ms-gitlab systemd[1]: gitlab-unicorn.service: Ignoring invalid environment assignment 'for i in $(grep -v '#' /etc/gitlab/gitlab-debian.conf | cut -d=-f 1)': /etc/default/gitlab Thanks, Libor -BEGIN PGP SIGNATURE- iQJJBAEBCAAzFiEEPGZVVU37tFmB0TQv8O+MbsKfR44FAlqEIHwVHGxpYm9yLmts ZXBhY0BiY29tLmN6AAoJEPDvjG7Cn0eOdhQQAJZ4dwoDavpwDz8m7+0JhbXyYOrz CJYSC/Z9v5bQNvNqj771GXuWdwIxd3sAudwJShctYZWJA51d4gl9wPJ9WZf1FX70 kYrrsyWm48fyHv1BSsk4rbgbYGQ5Pc5yZx7L/ekbZohKf+2IR0fgg+nPxtJ5pxnG g7/uIST+uQS3O66nRvkWccelnP/X0xIO/oiVAvCaI75Jj5YYx3ziyD9XyNx6NEoS NwEy0QQdPvBfJvHq/qS30fDbtkMdP4YMi0mbqb32+FBq0yxt8MCKoYFWSBEqdPV+ VXyeFkMNXxJd6Z/lZoRDnVJXepmBdhowVDdj5a28EHrVra+8hCYiQO4/xurnEXPO ACbFUFAgLOCC+9vyGe7fRZ2BpfeSmA/h1scPe9lXLE9WN2iyqlAmBO8RPLPTTcsd VybEkzkb9RbpqFgrgbqfkBCcH7e+RAsySeJQiZA3XKcPG9VoefcqNq5rRSt5OxuI 0adii49pbRLjL493v73FdCC+6GnlDrdgi9XX6/jqwX6jg3ofwjXI5MCzWJ8jrdvW 94QX9qbs7NfY7EjBrKwrRnXzDRlMKAZENwCzoUYV8pR+FIRDOAiYCSdZT+48jdvQ HPnCqSRNybeqMTTS1/yrMLZHtXDOtzP38nsVYFmsYZOQ5zMV7RGS84Pspf4aI6QV DvgsPm8FpIEhPZ2e =IcDF -END PGP SIGNATURE- ___ Pkg-ruby-extras-maintainers mailing list Pkg-ruby-extras-maintainers@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ruby-extras-maintainers