LINUX.ORG.RU

Помогите допилить сервис

 git-daemon, ,


0

1

Вот что вышло сейчас

[Unit]
Description=Git Daemon Instance

[Service]
EnvironmentFile=/etc/conf.d/git-daemon 
ExecStart=/usr/bin/git daemon --pid-file=/var/run/git-daemon.pid --user=${GIT_USER} --group=${GIT_GROUP} ${GITDAEMON_OPTS}

PIDFile=/var/run/git-daemon.pid

[Install]
WantedBy=multi-user.target

Но если в переменной GITDAEMON_OPTS больше одного параметра, то ловлю вот это:

Loaded: loaded (/etc/systemd/system/git-daemon.service; enabled)
   Active: failed (Result: exit-code) since (null); 1ms ago
  Process: 22461 ExecStart=/usr/bin/git daemon --pid-file=/var/run/git-daemon.pid --user=${GIT_USER} --group=${GIT_GROUP} ${GITDAEMON_OPTS} (code=exited, status=128)
 Main PID: 22461 (code=exited, status=128)

окт 06 22:47:36 localhost systemd[1]: Started Git Daemon Instance.
окт 06 22:47:36 localhost git[22461]: fatal: base-path '/var/git --syslog' does not exist or is not a directory
окт 06 22:47:36 localhost systemd[1]: git-daemon.service: main process exited, code=exited, status=128/n/a
окт 06 22:47:36 localhost systemd[1]: Unit git-daemon.service entered failed state.
Кто составлял сервисы подскажите что поправить надо.

★★★★★

Последнее исправление: deterok (всего исправлений: 1)

Попробуй сделать $GITDAEMON_OPTS, т. е. без фигурных скобок.

Из systemd.service(5):

Basic environment variable substitution is supported.
Use «${FOO}» as part of a word, or as a word of its own on the command line, in which case it will be replaced by the value of the environment variable including all whitespace it contains, resulting in a single argument.
Use «$FOO» as a separate word on the command line, in which case it will be replaced by the value of the environment variable split up at whitespace, resulting in zero or more arguments.

intelfx ★★★★★
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.