Add command line option to daemonize iiid process #2

Merged
merged 2 commits into from Feb 14, 2014

Conversation

Projects
None yet
2 participants
Contributor

older commented Feb 14, 2014

Add command line option to daemonize iiid process

Though probably not too frequent condition, this silent exit may result in a long troubleshooting session once it happens.

Owner

older replied Feb 14, 2014

Normally you'd run it this way from script which has to analyse exit status. But logging something won't hurt, of course. I'll add logging here.

Thanks. Yes, but even if exit status is caught, one may want to know what the failure was.

I haven't checked out the code, but for what I can see in github's frontend, the indentation level seems to be off here?

Owner

older replied Feb 14, 2014

Yes. Fixing it now.

Checked it out. And not just here. tabstop is 8 characters, not 4…

Why?

It says "By setting the umask to 0, we will have full access to the files generated by the daemon. Even if you aren't planning on using any files, it is a good idea to set the umask here anyway, just in case you will be accessing files on the filesystem." I'm not sure what makes it a good idea, but in our particular case it would mean that the files (photos) we create will be world-readable-writable. Honestly, I doubt it's a good idea. I'd drop this line.

Owner

older replied Feb 14, 2014

Agreed. I see that there is configuration option for umask anyway.

Oh, indeed. I forgot about that one. Then it largely doesn't matter if you set umask here or not ;-)

hacker commented on 4e64ab7 Feb 14, 2014

Anyway, thanks, looks mostly good to me and better than no support for daemonising, but if you're in the mood, you may also want to add the pidfile support ;-)

And no, I don't insist ;-)

Owner

older replied Feb 14, 2014

AFAIK most of the time PID files are handled by init scripts.
Anyway that would be separate pull request :)

Yes, I didn't expect it in one go, anyway, just shared my point.

As for initscripts, they can benefit from the pidfile created by the daemon. And yes, they can do without, moreover, they can do without daemonization, IIRC start-stop-daemon can do it for you if the daemon itself doesn't. So yes, one can live without pidfile and without daemonization.

On the other hand, including support for pidfile may even justify the use of libdaemon

I'd unindent this line too. To get it in line with other cases. Though, I think if you set tabstops to 8 you'll see all indentation troubles yourself.

Nice touch, I actually consider removing port option altogether, I can hardly imagine the use for it, as you can't set card to use other port — perhaps the only use is redirecting there using iptables

Just a thought.

Contributor

older commented Feb 14, 2014

Done. I've added another commit to pull request.

hacker commented on fdc2ed2 Feb 14, 2014

Thanks, Oleg, I'm pulling it in. That is, if I can find out how to do that on gihub, otherwise, I'll just merge it locally and push back ;)

@hacker hacker added a commit that referenced this pull request Feb 14, 2014

@hacker hacker Merge pull request #2 from older/master
Add command line option to daemonize iiid process
0f6efc2

@hacker hacker merged commit 0f6efc2 into hacker:master Feb 14, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment