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

variable for sleep seconds using systemd environment. #102

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

SaravanaStorageNetwork
Copy link
Member

Signed-off-by: Saravanakumar Arumugam [email protected]

@SaravanaStorageNetwork
Copy link
Member Author

@humblec
Copy link

humblec commented Aug 29, 2018

@SaravanaStorageNetwork LGTM. Waiting for one more lgtm before merging :)

@@ -4,7 +4,8 @@ After=glusterd.service

[Service]
Type=simple
ExecStart=/usr/local/bin/check_diskspace.sh
Environment="SLEEP_SECS=120"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be POLL_INTERVAL or simliar is better than SLEEP seconds. @SaravanaStorageNetwork

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@SaravanaStorageNetwork SaravanaStorageNetwork force-pushed the Add_env_variable_size_check branch from 12d3883 to 63a0e67 Compare August 29, 2018 11:56
@jarrpa
Copy link

jarrpa commented Aug 29, 2018

This doesn't seem to solve the problem at all. Best I can tell from the Environment directive, this does not merely set a default value for the env var but actually sets the value for the script's environment. I think John's initial suggestion of using PassEnvironment is correct, and that you should modify the script to have something like POLL_INTERVAL=${POLL_INTERVAL:-120} at the beginning. Also, the name shoud be more descriptive, maybe something like DISK_CHECK_POLL_INTERVAL.

@phlogistonjohn
Copy link

I agree with everything @jarrpa said in his previous comment.

@jarrpa
Copy link

jarrpa commented Aug 29, 2018

I just remembered to add here: Also the sleep should probably happen at the end of the loop. Unless there's a reason we want to wait before checking if the disk space is full.

@SaravanaStorageNetwork
Copy link
Member Author

I think John's initial suggestion of using PassEnvironment is correct, and that you should modify the script to have something like POLL_INTERVAL=${POLL_INTERVAL:-120} at the beginning.

Oops - I have missed the comment related to PassEnvironment by @phlogistonjohn - will check this out and update.

the sleep should probably happen at the end of the loop. Unless there's a reason we want to wait before checking if the disk space is full.

Reason to have the early wait is for glusterd to be up and running.
As you can see from the systemd file , this service is started after glusterd service (after all it is checking the configuration directory created/managed by glusterd).

Glusterd takes time to start(especially if too many volumes configured) and hence the wait immediate after glusterd start and then doing the check..

Signed-off-by: Saravanakumar Arumugam <[email protected]>
@SaravanaStorageNetwork SaravanaStorageNetwork changed the title variable for sleep seconds using sytemd environment. variable for sleep seconds using systemd environment. Aug 30, 2018
@jarrpa
Copy link

jarrpa commented Aug 30, 2018

I don't understand why we're waiting for glusterd. We're just checking disk space, what purpose does waiting for glusterd serve?

@SaravanaStorageNetwork
Copy link
Member Author

I don't understand why we're waiting for glusterd. We're just checking disk space, what purpose does waiting for glusterd serve?

Running out of space is ( very )worst case scenario , not required to be checked even before glusterd getting settled. glusterd daemon may need to connect to other peers and it may update content inside /var/lib/glusterd. This is just to give some room for glusterd daemon.

@jarrpa
Copy link

jarrpa commented Aug 31, 2018

It's not REQUIRED, okay, but is there an actual technical reason as to why you SHOULD or MUST wait? I still see no relation between glusterd being ready and checking for disk space, and thus no reason to wait.

Regardless, if no one else cares I'll just leave it there. The more important point is the PassEnvironment directive.

@humblec
Copy link

humblec commented Oct 8, 2018

@SaravanaStorageNetwork ping

@SaravanaStorageNetwork
Copy link
Member Author

@phlogistonjohn @humblec PTAL

@phlogistonjohn
Copy link

+1 on PassEnvironment

As @obnoxxx mentioned in a different context we may want to do something about some of the duplication between the this internal server and the external facing probe script, but we can tackle that separately.

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