cloudbeaver icon indicating copy to clipboard operation
cloudbeaver copied to clipboard

SystemD Control

Open FreeSoftwareServers opened this issue 4 years ago • 6 comments

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Please advise best way to control via systemd.

Describe the solution you'd like A clear and concise description of what you want to happen.

Example systemd script in Wiki.

FreeSoftwareServers avatar Apr 28 '20 02:04 FreeSoftwareServers

Here is what I'm using for now just FYI:

cat << 'EOF' >/opt/cloudbeaver/cb_start.sh
#!/bin/bash

cd /opt/cloudbeaver/cloudbeaver/deploy/cloudbeaver/ 
./run-server.sh
EOF
chmod +x /opt/cloudbeaver/cb_start.sh

cat << 'EOF' >/opt/cloudbeaver/cb_stop.sh
#!/bin/bash

PID="$(ps aux | grep cloudbeaver | awk '{print $2}' | head -1))"
kill $PID
EOF
chmod +x /opt/cloudbeaver/cb_stop.sh

cat << 'EOL' >/lib/systemd/system/cloudbeaver.service
[Unit]
Description=Cloud Beaver
Requires=network-online.target

[Service]
Restart=on-abnormal
ExecStart=/opt/cloudbeaver/cb_start.sh
ExecStop=/opt/cloudbeaver/cb_stop.sh

[Install]
WantedBy=multi-user.target
EOL
systemctl enable cloudbeaver
systemctl start cloudbeaver
systemctl status cloudbeaver

FreeSoftwareServers avatar Apr 28 '20 02:04 FreeSoftwareServers

Well, we usually use suervisord for this. Config looks like this:

[program:cloudbeaver_server]
directory=/path-to-cb
command=/path-to-cb/run-server.sh
user = user
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/cloudbeaver/server.log

serge-rider avatar Apr 29 '20 13:04 serge-rider

Well, we usually use suervisord for this. Config looks like this:

[program:cloudbeaver_server]
directory=/path-to-cb
command=/path-to-cb/run-server.sh
user = user
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/cloudbeaver/server.log

For a future DEB or RPM package I would assume support for SystemD would maybe a more preferable option since it comes built in on most popular distributions? It requires a privileged user to use it, but you need that anyway to install a DEB or RPM package, especially if this would eventually see potential in an Enterprise environment, also less dependencies to deal with for the sysadmin administering the cloudbeaver servers.

stogdan avatar Apr 29 '20 19:04 stogdan

Good point. Well, we probably will add "template" config for SystemD too.

serge-rider avatar Apr 30 '20 16:04 serge-rider

Any news?

GabrieleFrau avatar Feb 02 '21 09:02 GabrieleFrau

Unfortunately we do not have an estimated time for this ticket now.

kseniiaguzeeva avatar Jul 05 '21 09:07 kseniiaguzeeva

Unfortunately, we won’t support SystemD in the near future.

TatyanaSsau avatar May 30 '23 09:05 TatyanaSsau