-
Notifications
You must be signed in to change notification settings - Fork 14
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
Fixes for systemd unit #32
base: master
Are you sure you want to change the base?
Conversation
Added option -r <pidfile> for resmon. If none provided it will run without creating pidfile. If provided, it will try write it's pid into specified file. Resmon-systemd.service should have this file as an argument for resmon as a PIDFile option and in ExecStart option.
resmon
Outdated
close PIDFILE or die "can't close $PIDFILE"; | ||
} | ||
exit; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could fix style (spaces around operators and commas) if that matters.
Not sure about convention here, but maybe lowercase the $PIDFILE
var so it doesn't look like the file handle PIDFILE
, or just keep using $config->{pidfile}
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the three-arg form of open()
, instead of the two-arg form with string interpolation, and scalar filehandles instead of barewords:
open(my $pidfh, '>', $config->{pidfile}) or die "can't open $config->{pidfile}";
Thanks, updated pull request. |
'==' can not compare file handles. We can use fileno() function to compare numerically file numbers. Code without this returns "connection successful" when it timeouts and $fd is "undefined".
Typo fixed, thanks to @yakatz. Fixed excessive restarting of the unit and provided PIDFile for systemd.