Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nonroot: systemctl --user enable scylla-server.service failed on Ubuntu 18 #7288

Closed
syuu1228 opened this issue Sep 27, 2020 · 1 comment
Closed

Comments

@syuu1228
Copy link
Contributor

Seems like systemctl --user enable scylla-server.service failed because of symbolic link:

Do you want the Scylla server service to automatically start when the Scylla node boots?
Yes - Scylla server service automatically starts on Scylla node boot. No - skips this step. Note you will have to start the Scylla Server service manually.
[YES/no]
Failed to execute operation: Too many levels of symbolic links
Traceback (most recent call last):
  File "/home/vagrant/scylladb/scripts/libexec/scylla_setup", line 364, in <module>
    systemd_unit('scylla-server.service').enable()
  File "/home/vagrant/scylladb/scripts/scylla_util.py", line 765, in enable
    return run('systemctl {} enable {}'.format(self.ctlparam, self._unit))
  File "/home/vagrant/scylladb/scripts/scylla_util.py", line 504, in run
    return subprocess.run(cmd, stdout=stdout, stderr=stderr, shell=shell, check=exception, env=scylla_env).returncode
  File "/home/vagrant/scylladb/python3/lib64/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['systemctl', '--user', 'enable', 'scylla-server.service']' returned non-zero exit status 1.

Even though, symlink seems working:

vagrant@ubuntu1604:~/scylladb$ ls -l ~/.config/systemd/user/
total 12
lrwxrwxrwx 1 vagrant vagrant   51 Sep 27 09:35 node-exporter.service -> ../../../scylladb/etc/systemd/node-exporter.service
drwxrwxr-x 2 vagrant vagrant 4096 Sep 27 09:35 node-exporter.service.d
lrwxrwxrwx 1 vagrant vagrant   48 Sep 27 09:35 scylla-jmx.service -> ../../../scylladb/etc/systemd/scylla-jmx.service
drwxrwxr-x 2 vagrant vagrant 4096 Sep 27 09:35 scylla-jmx.service.d
lrwxrwxrwx 1 vagrant vagrant   51 Sep 27 09:35 scylla-server.service -> ../../../scylladb/etc/systemd/scylla-server.service
drwxrwxr-x 2 vagrant vagrant 4096 Sep 27 09:35 scylla-server.service.d
vagrant@ubuntu1604:~/scylladb$ systemctl --user cat scylla-server.service
# /home/vagrant/.config/systemd/user/../../../scylladb/etc/systemd/scylla-server.service
[Unit]
Description=Scylla Server
Wants=scylla-jmx.service
Wants=scylla-housekeeping-restart.timer
Wants=scylla-housekeeping-daily.timer

[Service]
PermissionsStartOnly=true
Type=notify
LimitMEMLOCK=infinity
LimitNOFILE=800000
LimitAS=infinity
LimitNPROC=8096
EnvironmentFile=/etc/sysconfig/scylla-server
EnvironmentFile=/etc/scylla.d/*.conf
ExecStartPre=/opt/scylladb/scripts/scylla_prepare
ExecStart=/usr/bin/scylla $SCYLLA_ARGS $SEASTAR_IO $DEV_MODE $CPUSET $MEM_CONF
ExecStopPost=/opt/scylladb/scripts/scylla_stop
TimeoutStartSec=1y
TimeoutStopSec=900
KillMode=process
Restart=on-abnormal
User=scylla
OOMScoreAdjust=-950
StandardOutput=syslog
StandardError=syslog
SyslogLevelPrefix=false
Slice=scylla-server.slice

[Install]
WantedBy=multi-user.target

# /home/vagrant/.config/systemd/user/scylla-server.service.d/nonroot.conf
[Service]
EnvironmentFile=
EnvironmentFile=/home/vagrant/scylladb//etc/sysconfig/scylla-server
EnvironmentFile=/home/vagrant/scylladb/etc/scylla.d/*.conf
ExecStartPre=
ExecStart=
ExecStart=/home/vagrant/scylladb/bin/scylla $SCYLLA_ARGS $SEASTAR_IO $DEV_MODE $CPUSET
ExecStopPost=
User=

Maybe we should stop using symlink for this, we can just copy these unit files.

syuu1228 added a commit to syuu1228/scylla that referenced this issue Sep 28, 2020
On some environment, systemctl enable <service> fails when we use symlink.
So just directly copy systemd units to ~/.config/systemd/user, instead of
creating symlink.

Fixes scylladb#7288
syuu1228 added a commit to syuu1228/scylla-jmx that referenced this issue Sep 28, 2020
On some environment, systemctl enable <service> fails when we use symlink.
So just directly copy systemd units to ~/.config/systemd/user, instead of
creating symlink.

See scylladb/scylladb#7288
avikivity pushed a commit to scylladb/scylla-jmx that referenced this issue Sep 29, 2020
On some environment, systemctl enable <service> fails when we use symlink.
So just directly copy systemd units to ~/.config/systemd/user, instead of
creating symlink.

See scylladb/scylladb#7288
avikivity added a commit that referenced this issue Sep 29, 2020
* tools/jmx 45e4f28...25bcd76 (1):
  > install.sh: stop using symlinks for systemd units on nonroot mode

Fixes #7288.
@avikivity
Copy link
Member

This is for systemd user mode. Already on 4.3, not backporting further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants