Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HPCasCode
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hpc-team
HPCasCode
Commits
aa5a5dec
Commit
aa5a5dec
authored
7 years ago
by
Jafar Lie
Browse files
Options
Downloads
Patches
Plain Diff
clean up X script and cron install
parent
eab73154
No related branches found
No related tags found
2 merge requests
!161
Slurm epilog
,
!151
clean up X script and cron install
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
roles/cleanup_x/files/cleanup-x.sh
+20
-0
20 additions, 0 deletions
roles/cleanup_x/files/cleanup-x.sh
roles/cleanup_x/tasks/main.yml
+16
-0
16 additions, 0 deletions
roles/cleanup_x/tasks/main.yml
with
36 additions
and
0 deletions
roles/cleanup_x/files/cleanup-x.sh
0 → 100755
+
20
−
0
View file @
aa5a5dec
#!/bin/bash
# Grep to find out whether there's X process running and user logged in
# Is Desktop running on this machine? Anything greater than 0 means yes
DESKTOPRUNNING
=
`
/opt/slurm-16.05.4/bin/squeue |
grep
desktop |
grep
-c
$HOSTNAME
`
# Is X running? Anything greater than 0 means yes
XRUNNING
=
`
ps aux |
grep
"/usr/bin/X"
|
grep
-c
root
`
# This checks if no desktop is running but X is still there
if
[
"
$DESKTOPRUNNING
"
==
0
]
&&
[
"XRUNNING"
>
0
]
then
# Trying to get XPID
if
[
-z
"
$XPID
"
]
then
XPID
=
`
ps
-ef
|
grep
"/usr/bin/X"
|
grep
root |
awk
'{print $2}'
`
kill
$XPID
>
/dev/null 2>&1
fi
fi
This diff is collapsed.
Click to expand it.
roles/cleanup_x/tasks/main.yml
0 → 100644
+
16
−
0
View file @
aa5a5dec
---
-
name
:
Copy cleanup-x.sh to the server
copy
:
src
:
cleanup-x.sh
dest
:
/usr/local/bin/cleanup-x.sh
mode
:
0755
owner
:
root
sudo
:
true
-
name
:
Install cron job on VisNodes
sudo
:
true
cron
:
name
:
Clean up X Check
special_time
:
hourly
job
:
/usr/local/bin/cleanup-x.sh
user
:
root
This diff is collapsed.
Click to expand it.
Jafar Lie
@jlie0003
mentioned in commit
b2dbbd6a
·
4 years ago
mentioned in commit
b2dbbd6a
mentioned in commit b2dbbd6a650254cf5037fab4998c181a65960ffe
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment