|
From: Alexandre K. <ale...@ta...> - 2015-10-22 05:31:40
|
Sorry I did a small typo:
echo "User=${RUN_AS_USER"} >> "${SYSTEMD_SERVICE_FILE}"
should be:
echo "User=${RUN_AS_USER}" >> "${SYSTEMD_SERVICE_FILE}"
Regards,
Alexandre Klein
Alexandre Klein
Tanuki Software, Ltd.
6-18-10-4F Nishi-Kasai, Edogawa-ku
Tokyo 134-0088 Japan
Tel: +81-3-3878-3211
Fax: +81-3-3878-0313
http://www.tanukisoftware.com
On Thu, Oct 22, 2015 at 2:27 PM, Alexandre Klein <
ale...@ta...> wrote:
> Adam,
>
> Thank you for letting us know about this issue.
>
> You are correct, when creating the systemd service file, we don't check if
> RUN_AS_USER is set.Thus the service is always run as root.
>
> We will fix this in our next release (3.5.28).
>
> In the meantime, in case you need this to be fixed asap, you can modify
> the script file.
> Go to the function systemdInstall() and add these lines after "echo
> "ExecStop=....":
>
> if [ "X${RUN_AS_USER}" != "X" ] ; then
> echo "User=${RUN_AS_USER"} >> "${SYSTEMD_SERVICE_FILE}"
> fi
>
> Please let me know if you have any other questions.
>
> Regards,
> Alexandre Klein
>
>
> Alexandre Klein
> Tanuki Software, Ltd.
> 6-18-10-4F Nishi-Kasai, Edogawa-ku
> Tokyo 134-0088 Japan
> Tel: +81-3-3878-3211
> Fax: +81-3-3878-0313
> http://www.tanukisoftware.com
>
> On Mon, Oct 5, 2015 at 8:43 PM, Adam Retter <ad...@ex...> wrote:
>
>> In version 3.5.26 of the Wrapper, I have configured the lines:
>>
>> RUN_AS_USER=my-user
>> USE_SYSTEMD=true
>>
>> in the shell file, however when installing the wrapper the generated
>> systemd config file is missing the user property.
>> The resultant systemd config /etc/systemd/system/my-service.service:
>>
>> [Unit]
>> Description=My Service
>> After=syslog.target
>>
>> [Service]
>> Type=forking
>> ExecStart=/usr/local/my-app/tools/wrapper/bin/my-app.sh start sysd
>> ExecStop=/usr/local/my-app/tools/wrapper/bin/my-app.sh stop sysd
>>
>> [Install]
>> WantedBy=multi-user.target
>>
>>
>> However systemd won't correctly start and stop the service because it
>> attempts to use the wrong user. To fix this I have to manually modify
>> /etc/systemd/system/my-service.service after installation and add the
>> following to the `[Service]` section:
>>
>> User=my-user
>>
>>
>> Thus looks like a bug in the installation of the service wrapper to
>> me, can anyone confirm?
>> I have tried this on both Ubuntu Vivid and Ubuntu Wily.
>>
>> --
>> Adam Retter
>>
>> eXist Developer
>> { United Kingdom }
>> ad...@ex...
>> irc://irc.freenode.net/existdb
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Wrapper-user mailing list
>> Wra...@li...
>> https://lists.sourceforge.net/lists/listinfo/wrapper-user
>>
>
>
|