Skip to content

Conversation

@seriv
Copy link

@seriv seriv commented Nov 16, 2015

Typo fixed, thanks to @yakatz. Fixed excessive restarting of the unit and provided PIDFile for systemd.

yakatz and others added 3 commits November 16, 2015 16:46
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
Copy link

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}.

Copy link

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}";

@seriv
Copy link
Author

seriv commented Nov 18, 2015

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".
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

Successfully merging this pull request may close these issues.

4 participants