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

How to convert to a service #59

Open
stacka1 opened this issue Jan 6, 2019 · 2 comments
Open

How to convert to a service #59

stacka1 opened this issue Jan 6, 2019 · 2 comments

Comments

@stacka1
Copy link

stacka1 commented Jan 6, 2019

How to you convert the collector to a service?

I put together this file under /lib/systemd/system/ but things are working as expected....any advise?

[Unit]
Description=Isilon SDK for Grafana
After=influxdb.service
Requires=influxdb.service
StartLimitIntervalSec=350

[Service]
Type=simple
Restart=always
Restart=on-failure
RestartSec=30
User=root
ExecStart=/root/start-sdk.sh
[Install]
WantedBy=multi-user.target

@fr3man1
Copy link

fr3man1 commented Jan 15, 2019

I think, that. you cannot convert this daemon-already isi_data_connecto because it uses a module called daemons and then detaches itself from parent pid. In default isi_data_connector there are three execution types : start, stop, restart, but if you look in isi_data_insights_d.py, then there is a daemons.run(), which lets you start a script, without detaching, so you must introduce the run execution type. Check args.action in isi_data_insights_d.py;. if still unclear, let me know.

@tenortim
Copy link
Collaborator

tenortim commented Nov 6, 2019

Yes, as written, the code already turns itself into a daemon. It would not be difficult to add support for the collector to run in the foreground, but I believe you can already use it under systemd as a service, provided you set the Type to "forking" instead of simple:

If set to forking, it is expected that the process configured with ExecStart= will call fork() as part of its start-up. The parent process is expected to exit when start-up is complete and all communication channels are set up. The child continues to run as the main service process, and the service manager will consider the unit started when the parent process exits. This is the behavior of traditional UNIX services. If this setting is used, it is recommended to also use the PIDFile= option, so that systemd can reliably identify the main process of the service. systemd will proceed with starting follow-up units as soon as the parent process exits.

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

No branches or pull requests

3 participants