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

Avoid reactivating a deactivated lighttpd service #1485

Merged
merged 9 commits into from Jul 16, 2017

Conversation

Projects
None yet
3 participants
@WaLLy3K
Copy link
Collaborator

WaLLy3K commented May 19, 2017

By submitting this pull request, I confirm the following:

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.

How familiar are you with the codebase?:

3


@dschaper

This comment has been minimized.

Copy link
Member

dschaper commented May 22, 2017

Should we add in a systemctl call to this to check and see if the status is disabled or will the service call cover this situation as well?

@dschaper

This comment has been minimized.

Copy link
Member

dschaper commented May 22, 2017

[danschaper@Horizon ~]$ systemctl is-enabled sshd
enabled
@WaLLy3K

This comment has been minimized.

Copy link
Collaborator Author

WaLLy3K commented May 22, 2017

Getting the exit code from the service command will let us know if lighttpd was active when it was called, so it should cover it. Your solution looks neater though!

I remember now that it might be appropriate to check both: https://github.com/pi-hole/pi-hole/blob/master/pihole#L175

@dschaper

This comment has been minimized.

Copy link
Member

dschaper commented May 22, 2017

systemctl is preferred if they are running systemd as we can pull more information from it, but if they are on Upstart or sysv then service is the choice. We also have some users running in a jailed environment that systemctl exists but may return false information. #1218

@dschaper

This comment has been minimized.

Copy link
Member

dschaper commented May 22, 2017

Also, on a fresh install where we are installing lighttpd will this still fire? (Haven't had a chance to test on a live system to check it, so just a general question.)

@WaLLy3K

This comment has been minimized.

Copy link
Collaborator Author

WaLLy3K commented May 23, 2017

$useUpdateVars should not be true on a fresh install, meaning the [[ -z "${LIGHTTPD_ENABLED}" ]] conditional should start the service.

@PromoFaux

This comment has been minimized.

Copy link
Member

PromoFaux commented Jun 28, 2017

Is this supposed to happen?

image

image

PromoFaux added some commits Jul 15, 2017

Move `finalexports` to the very end of the install script
set value of LIGHTTPD_ENABLED to 1 or 0 depending on whether or not lighttpd is enabled or disabled.
actually save LIGHTTPD_ENABLED value to setupvars.conf

Signed-off-by: Adam Warner <adamw@rner.email>
add [[ -z "${LIGHTTPD_ENABLED}" ]] back in!
Signed-off-by: Adam Warner <adamw@rner.email>
@PromoFaux

This comment has been minimized.

Copy link
Member

PromoFaux commented Jul 16, 2017

for the service call, I ended up going with:
LIGHTTPD_ENABLED=$(service lighttpd status | sed -n 2p | grep -c 'enabled')

Can either of you see any issues with that?

WaLLy3K and others added some commits Jul 16, 2017

change of plan, don't need that [[ -z "${LIGHTTPD_ENABLED}" ]]
Signed-off-by: Adam Warner <adamw@rner.email>
@PromoFaux

This comment has been minimized.

Copy link
Member

PromoFaux commented Jul 16, 2017

Tested extensively

Approved.

Approved with PullApprove

@PromoFaux PromoFaux merged commit c9a98b6 into development Jul 16, 2017

5 checks passed

codacy/pr Good work! A positive pull request.
Details
code-review/pullapprove Approved by PromoFaux, WaLLy3K
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details

@PromoFaux PromoFaux deleted the tweak/lighttpd-status branch Jul 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.