Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

[Help Wanted] make Dragonfly managed by systemd #1123

Open
starnop opened this issue Dec 4, 2019 · 8 comments
Open

[Help Wanted] make Dragonfly managed by systemd #1123

starnop opened this issue Dec 4, 2019 · 8 comments

Comments

@starnop
Copy link
Contributor

starnop commented Dec 4, 2019

Why you need it?

Users have to write their own scripts to handle the startup and management of Dragonfly components when they use Dragonfly on physical machines. And systemd provides a complete solution that.

So we can provide a systemd file. And later, we can even make our components installed by package management tools such as yum, apt, etc directly.

How it could be?

Other related information

@yeya24
Copy link
Collaborator

yeya24 commented Dec 7, 2019

Is this a systemd file for managing all Dragonfly components? Including dfdaemon and supernode?

@inoc603
Copy link
Member

inoc603 commented Dec 8, 2019

I can take this. I implemented the deb and rpm packaging script. It would be rather easy to add 2 services. One for dfdamon, and one for supernode. dfdemon is fine, but I think supernode is not a very good name for a service. The name doesn't show its relationship to the dragonfly project. Maybe we need a better name for it.

@starnop
Copy link
Contributor Author

starnop commented Dec 11, 2019

but I think supernode is not a very good name for a service. The name doesn't show its relationship to the dragonfly project.

How about dfsupernode? 😢 cc/ @lowzj

@lowzj
Copy link
Member

lowzj commented Dec 16, 2019

agree. I could be named dfsupernode in systemd as an abbreviation for dragonfly-supernode.

@starnop
Copy link
Contributor Author

starnop commented Dec 19, 2019

@inoc603 Any updates?

@inoc603
Copy link
Member

inoc603 commented Dec 20, 2019

@inoc603 Any updates?

I finished the unit files and script. I'll add some test and create a PR this weekend.

@inoc603
Copy link
Member

inoc603 commented Dec 23, 2019

@starnop I ran into some problems testing the service, namely:

  • we need default config files to put in the package, probably generated as issues#1069 suggested.
  • in the default config file, we probably need a new default path for the local repo .small_dragonfly, for example somewhere under /opt/dragonfly other than $HOME, since the user may be root when running on the host machine directly.
  • supernode requires nginx as dependency, we need to make sure that the installation doesn't conflict with or break existing nginx config on the host.

I'm not quite familiar with the supernode part and I think we should create a branch in the main repo and work on it together. I'll add what I've wrote and how to test the service in a docker container.

@poblahblahblah
Copy link

Here's what we are using to manage the supernode process in systemd...

/etc/systemd/system/dragonfly-supernode.service:

[Unit]
Description = Dragonfly Supernode
Documentation = https://github.com/dragonflyoss/Dragonfly
After = network-online.target
Wants = network-online.target

[Service]
Type = simple
User = nobody
Group = nogroup
Restart = on-failure
LimitNOFILE = 49152
ExecStart = /usr/local/bin/supernode --config /opt/dragonfly/supernode/supernode.yml

[Install]
WantedBy = multi-user.target

sungjunyoung pushed a commit to sungjunyoung/Dragonfly that referenced this issue May 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants