Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
af7021c
Changed pylustrequota to a generic python lustreclient extension
Martin-Rehr Nov 25, 2025
437a6a7
Changed lustre quota from cron job to grid daemon
Martin-Rehr Nov 25, 2025
fabce46
Updated unit tests to match new grid quota daemon setup
Martin-Rehr Nov 25, 2025
b6c56f1
Added 'quota_update_interval' option to generateconfs
Martin-Rehr Nov 25, 2025
5261194
Addwed missing 'user_quota_log' entry to configuration
Martin-Rehr Nov 25, 2025
375f634
Added missing 'update_interval' to MiGserver-template.conf
Martin-Rehr Nov 25, 2025
9c9e976
Added 'update_interval' to MiGserver.conf fixture
Martin-Rehr Nov 25, 2025
aa83180
Minor comment corrections thanks to @jonasbardino
Martin-Rehr Nov 27, 2025
1132a2d
Added 'lustreclient' to 'c-ext-sanity-check' ignore paths as it depen…
Martin-Rehr Dec 1, 2025
be7f1bc
Added check for 'lustreclient' module import
Martin-Rehr Dec 2, 2025
d5a9d3c
Added log error message if requested 'quota' backend is unsupported
Martin-Rehr Dec 2, 2025
3933cd8
Removed trailing whitespace
Martin-Rehr Dec 2, 2025
8312ebd
Restrict 'lustreclient.lfs' import exception to 'ImportError' to sati…
Martin-Rehr Dec 2, 2025
9dba870
Removed absolete 'import sys'
Martin-Rehr Dec 2, 2025
559f60c
lustrequota: Added check for 'psutil' module
Martin-Rehr Dec 2, 2025
17f4194
Added quota unittest
Martin-Rehr Dec 2, 2025
f888463
python-c-ext-sanity-check: Added support for skipping paths specified…
Martin-Rehr Dec 11, 2025
72655fd
python-c-ext-sanity-check: Removed double 'env'
Martin-Rehr Dec 11, 2025
7dd5ed4
python-c-ext-sanity-check: Added missing 'filter'
Martin-Rehr Dec 11, 2025
af450ff
python-c-ext-sanity-check: Changed 'env.skip' to 'env.paths-ignore-sp…
Martin-Rehr Dec 11, 2025
1a90bbd
python-c-ext-sanity-check: Test
Martin-Rehr Dec 12, 2025
f6e9e7b
migrid init: Append /usr/local/(s)bin to existing PATH variable as su…
Martin-Rehr Dec 17, 2025
247ea4f
python-c-ext-sanity-check: Added 'PATHS_IGNORE_SPLINT' (#397)
Martin-Rehr Dec 17, 2025
3245588
Changed pylustrequota to a generic python lustreclient extension
Martin-Rehr Nov 25, 2025
34b2473
Changed lustre quota from cron job to grid daemon
Martin-Rehr Nov 25, 2025
e37279e
Updated unit tests to match new grid quota daemon setup
Martin-Rehr Nov 25, 2025
546345a
Added 'quota_update_interval' option to generateconfs
Martin-Rehr Nov 25, 2025
e6d4d60
Addwed missing 'user_quota_log' entry to configuration
Martin-Rehr Nov 25, 2025
119ca23
Added missing 'update_interval' to MiGserver-template.conf
Martin-Rehr Nov 25, 2025
8c56546
Added 'update_interval' to MiGserver.conf fixture
Martin-Rehr Nov 25, 2025
a276e09
Minor comment corrections thanks to @jonasbardino
Martin-Rehr Nov 27, 2025
391ccea
Added 'lustreclient' to 'c-ext-sanity-check' ignore paths as it depen…
Martin-Rehr Dec 1, 2025
3fcbb77
Added check for 'lustreclient' module import
Martin-Rehr Dec 2, 2025
a195313
Added log error message if requested 'quota' backend is unsupported
Martin-Rehr Dec 2, 2025
49cda2f
Removed trailing whitespace
Martin-Rehr Dec 2, 2025
5fd857b
Restrict 'lustreclient.lfs' import exception to 'ImportError' to sati…
Martin-Rehr Dec 2, 2025
7a7ac27
Removed absolete 'import sys'
Martin-Rehr Dec 2, 2025
fbeca52
lustrequota: Added check for 'psutil' module
Martin-Rehr Dec 2, 2025
fd536c4
Added quota unittest
Martin-Rehr Dec 2, 2025
1b1bf91
python-c-ext-sanity-check: Test
Martin-Rehr Dec 12, 2025
4034121
migrid init: Append /usr/local/(s)bin to existing PATH variable as su…
Martin-Rehr Dec 17, 2025
5e02fce
Merge remote-tracking branch 'refs/remotes/origin/adjust/lustre-quota…
Martin-Rehr Dec 17, 2025
56604f3
Removed 'newline'
Martin-Rehr Dec 17, 2025
b781f5a
Adjusted migrid-init fixture to new PATH setup
Martin-Rehr Dec 17, 2025
895b073
Changed grid_quota.py description as suggested by @jonasbardino
Martin-Rehr Dec 17, 2025
3c24a35
python-c-ext-sanity-check: Removed test 'newline'
Martin-Rehr Dec 17, 2025
ba81916
migrid init: Define PATH if it doesn't exists as suggested by @jonasb…
Martin-Rehr Dec 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mig/install/MiGserver-template.conf
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ default_mount_re = SSHFS-2.X-1

[QUOTA]
backend = __QUOTA_BACKEND__
update_interval = __QUOTA_UPDATE_INTERVAL__
user_limit = __QUOTA_USER_LIMIT__
vgrid_limit = __QUOTA_VGRID_LIMIT__

Expand Down
1 change: 1 addition & 0 deletions mig/install/generateconfs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
Expand All @@ -20,7 +20,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Check warning on line 23 in mig/install/generateconfs.py

View workflow job for this annotation

GitHub Actions / Style check python and annotate

line too long (81 > 80 characters)
#
# -- END_HEADER ---
#
Expand Down Expand Up @@ -252,6 +252,7 @@
'seafile_seafhttp_port',
'seafile_client_port',
'seafile_quota',
'quota_update_interval',
'quota_user_limit',
'quota_vgrid_limit',
'wwwserve_max_bytes',
Expand Down
62 changes: 0 additions & 62 deletions mig/install/miglustrequota-template.sh.cronjob

This file was deleted.

56 changes: 54 additions & 2 deletions mig/install/migrid-init.d-deb-template
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ if [ -z "$PYTHONPATH" ]; then
else
PYTHONPATH=${MIG_PATH}:$PYTHONPATH
fi
# Make sure '/usr/local/(s)bin' is in path and force lookup order
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# you probably do not want to modify these...
PID_DIR=${PID_DIR:-/var/run}
MIG_LOG=${MIG_STATE}/log
Expand All @@ -62,13 +65,14 @@ MIG_FTPS=${MIG_CODE}/server/grid_ftps.py
MIG_NOTIFY=${MIG_CODE}/server/grid_notify.py
MIG_IMNOTIFY=${MIG_CODE}/server/grid_imnotify.py
MIG_VMPROXY=${MIG_CODE}/server/grid_vmproxy.py
MIG_QUOTA=${MIG_CODE}/server/grid_quota.py
MIG_CHKUSERROOT=${MIG_CODE}/server/chkuserroot.py
MIG_CHKSIDROOT=${MIG_CODE}/server/chksidroot.py

show_usage() {
echo "Usage: migrid {start|stop|status|restart|reload}[daemon DAEMON]"
echo "where daemon is left out for all or given along with DAEMON as one of the following"
echo "(script|monitor|sshmux|events|cron|janitor|transfers|openid|sftp|sftpsubsys|webdavs|ftps|notify|imnotify|vmproxy|all)"
echo "(script|monitor|sshmux|events|cron|janitor|transfers|openid|sftp|sftpsubsys|webdavs|ftps|notify|imnotify|vmproxy|quota|all)"
}

check_enabled() {
Expand Down Expand Up @@ -264,6 +268,18 @@ start_vmproxy() {
log_end_msg 1 || true
fi
}
start_quota() {
check_enabled "quota" || return 0
DAEMON_PATH=${MIG_QUOTA}
SHORT_NAME=$(basename ${DAEMON_PATH})
PID_FILE="$PID_DIR/${SHORT_NAME}.pid"
log_daemon_msg "Starting MiG quota daemon" ${SHORT_NAME} || true
if start-stop-daemon --start --quiet --oknodo --pidfile ${PID_FILE} --make-pidfile --user root --chuid root --background --name ${SHORT_NAME} --startas ${DAEMON_PATH} ; then
log_end_msg 0 || true
else
log_end_msg 1 || true
fi
}
start_sftpsubsys() {
check_enabled "sftp_subsys" || return 0
DAEMON_PATH=${MIG_SFTPSUBSYS}
Expand Down Expand Up @@ -292,6 +308,7 @@ start_all() {
start_notify
start_imnotify
start_vmproxy
start_quota
return 0
}

Expand Down Expand Up @@ -524,6 +541,19 @@ stop_vmproxy() {
log_end_msg 1 || true
fi
}
stop_quota() {
check_enabled "quota" || return 0
DAEMON_PATH=${MIG_QUOTA}
SHORT_NAME=$(basename ${DAEMON_PATH})
PID_FILE="$PID_DIR/${SHORT_NAME}.pid"
log_daemon_msg "Stopping MiG quota" ${SHORT_NAME} || true
if start-stop-daemon --stop --quiet --oknodo --pidfile ${PID_FILE} ; then
rm -f ${PID_FILE}
log_end_msg 0 || true
else
log_end_msg 1 || true
fi
}
stop_sftpsubsys_workers() {
DAEMON_PATH=${MIG_SFTPSUBSYS_WORKER}
SHORT_NAME=$(basename ${DAEMON_PATH})
Expand Down Expand Up @@ -563,6 +593,7 @@ stop_all() {
stop_notify
stop_imnotify
stop_vmproxy
stop_quota
return 0
}

Expand Down Expand Up @@ -735,6 +766,18 @@ reload_vmproxy() {
log_end_msg 1 || true
fi
}
reload_quota() {
check_enabled "quota" || return 0
DAEMON_PATH=${MIG_QUOTA}
SHORT_NAME=$(basename ${DAEMON_PATH})
PID_FILE="$PID_DIR/${SHORT_NAME}.pid"
log_daemon_msg "Reloading MiG quota" ${SHORT_NAME} || true
if start-stop-daemon --stop --signal HUP --quiet --oknodo --pidfile ${PID_FILE} ; then
log_end_msg 0 || true
else
log_end_msg 1 || true
fi
}
reload_sftpsubsys_workers() {
DAEMON_PATH=${MIG_SFTPSUBSYS_WORKER}
SHORT_NAME=$(basename ${DAEMON_PATH})
Expand Down Expand Up @@ -787,6 +830,7 @@ reload_all() {
reload_notify
reload_imnotify
reload_vmproxy
reload_quota
# Apache helpers to verify proper chrooting
reload_chkuserroot
reload_chksidroot
Expand Down Expand Up @@ -891,6 +935,13 @@ status_vmproxy() {
PID_FILE="$PID_DIR/${SHORT_NAME}.pid"
status_of_proc -p ${PID_FILE} ${DAEMON_PATH} ${SHORT_NAME}
}
status_quota() {
check_enabled "quota" || return 0
DAEMON_PATH=${MIG_QUOTA}
SHORT_NAME=$(basename ${DAEMON_PATH})
PID_FILE="$PID_DIR/${SHORT_NAME}.pid"
status_of_proc -p ${PID_FILE} ${DAEMON_PATH} ${SHORT_NAME}
}
status_sftpsubsys_workers() {
DAEMON_PATH=${MIG_SFTPSUBSYS_WORKER}
SHORT_NAME=$(basename ${DAEMON_PATH})
Expand Down Expand Up @@ -929,6 +980,7 @@ status_all() {
status_notify
status_imnotify
status_vmproxy
status_quota
return 0
}

Expand All @@ -940,7 +992,7 @@ test -f ${MIG_SCRIPT} || exit 0

# Force valid target
case "$2" in
script|monitor|sshmux|events|cron|janitor|transfers|openid|sftp|sftpsubsys|webdavs|ftps|notify|imnotify|vmproxy|all)
script|monitor|sshmux|events|cron|janitor|transfers|openid|sftp|sftpsubsys|webdavs|ftps|notify|imnotify|vmproxy|quota|all)
TARGET="$2"
;;
'')
Expand Down
53 changes: 51 additions & 2 deletions mig/install/migrid-init.d-rh-template
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
# processname: grid_notify.py
# processname: grid_imnotify.py
# processname: grid_vmproxy.py
# processname: grid_quota.py
# processname: sshd
# config: /etc/sysconfig/migrid
#
Expand Down Expand Up @@ -74,6 +75,9 @@ if [ -z "$PYTHONPATH" ]; then
else
export PYTHONPATH=${MIG_PATH}:$PYTHONPATH
fi
# Make sure '/usr/local/(s)bin' is in path and force lookup order
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# you probably do not want to modify these...
PID_DIR=${PID_DIR:-/var/run}
MIG_LOG=${MIG_STATE}/log
Expand All @@ -93,13 +97,14 @@ MIG_FTPS=${MIG_CODE}/server/grid_ftps.py
MIG_NOTIFY=${MIG_CODE}/server/grid_notify.py
MIG_IMNOTIFY=${MIG_CODE}/server/grid_imnotify.py
MIG_VMPROXY=${MIG_CODE}/server/grid_vmproxy.py
MIG_QUOTA=${MIG_CODE}/server/grid_quota.py
MIG_CHKUSERROOT=${MIG_CODE}/server/chkuserroot.py
MIG_CHKSIDROOT=${MIG_CODE}/server/chksidroot.py

show_usage() {
echo "Usage: migrid {start|stop|status|restart|reload}[daemon DAEMON]"
echo "where daemon is left out for all or given along with DAEMON as one of the following"
echo "(script|monitor|sshmux|events|cron|janitor|transfers|openid|sftp|sftpsubsys|webdavs|ftps|notify|imnotify|vmproxy|all)"
echo "(script|monitor|sshmux|events|cron|janitor|transfers|openid|sftp|sftpsubsys|webdavs|ftps|notify|imnotify|vmproxy|quota|all)"
}

check_enabled() {
Expand Down Expand Up @@ -353,6 +358,21 @@ start_vmproxy() {
[ $RET2 -ne 0 ] && echo "Warning: vmproxy not started."
echo
}
start_quota() {
check_enabled "quota" || return
DAEMON_PATH=${MIG_QUOTA}
SHORT_NAME=$(basename ${DAEMON_PATH})
PID_FILE="$PID_DIR/${SHORT_NAME}.pid"
echo -n "Starting MiG quota daemon: $SHORT_NAME"
daemon --user root --pidfile ${PID_FILE} \
"${DAEMON_PATH} >> ${MIG_LOG}/quota.out 2>&1 &"
fallback_save_pid "$DAEMON_PATH" "$PID_FILE" "$!"
RET2=$?
[ $RET2 -eq 0 ] && success
echo
[ $RET2 -ne 0 ] && echo "Warning: quota not started."
echo
}
start_sftpsubsys() {
check_enabled "sftp_subsys" || return
DAEMON_PATH=${MIG_SFTPSUBSYS}
Expand Down Expand Up @@ -385,6 +405,7 @@ start_all() {
start_notify
start_imnotify
start_vmproxy
start_quota
return 0
}

Expand Down Expand Up @@ -545,6 +566,15 @@ stop_vmproxy() {
killproc ${DAEMON_PATH}
echo
}
stop_quota() {
check_enabled "quota" || return
DAEMON_PATH=${MIG_QUOTA}
SHORT_NAME=$(basename ${DAEMON_PATH})
PID_FILE="$PID_DIR/${SHORT_NAME}.pid"
echo -n "Shutting down MiG quota: $SHORT_NAME "
killproc ${DAEMON_PATH}
echo
}
stop_sftpsubsys_workers() {
DAEMON_PATH=${MIG_SFTPSUBSYS_WORKER}
SHORT_NAME=$(basename ${DAEMON_PATH})
Expand Down Expand Up @@ -588,6 +618,7 @@ stop_all() {
stop_notify
stop_imnotify
stop_vmproxy
stop_quota
return 0
}

Expand Down Expand Up @@ -717,6 +748,15 @@ reload_vmproxy() {
killproc ${DAEMON_PATH} -HUP
echo
}
reload_quota() {
check_enabled "quota" || return
DAEMON_PATH=${MIG_QUOTA}
SHORT_NAME=$(basename ${DAEMON_PATH})
PID_FILE="$PID_DIR/${SHORT_NAME}.pid"
echo -n "Reloading MiG quota: $SHORT_NAME "
killproc ${DAEMON_PATH} -HUP
echo
}
reload_sftpsubsys_workers() {
DAEMON_PATH=${MIG_SFTPSUBSYS_WORKER}
SHORT_NAME=$(basename ${DAEMON_PATH})
Expand Down Expand Up @@ -773,6 +813,7 @@ reload_all() {
reload_notify
reload_imnotify
reload_vmproxy
reload_quota
# Apache helpers to verify proper chrooting
reload_chkuserroot
reload_chksidroot
Expand Down Expand Up @@ -877,6 +918,13 @@ status_vmproxy() {
PID_FILE="$PID_DIR/${SHORT_NAME}.pid"
status ${DAEMON_PATH}
}
status_quota() {
check_enabled "quota" || return
DAEMON_PATH=${MIG_QUOTA}
SHORT_NAME=$(basename ${DAEMON_PATH})
PID_FILE="$PID_DIR/${SHORT_NAME}.pid"
status ${DAEMON_PATH}
}
status_sftpsubsys_workers() {
DAEMON_PATH=${MIG_SFTPSUBSYS_WORKER}
SHORT_NAME=$(basename ${DAEMON_PATH})
Expand Down Expand Up @@ -916,6 +964,7 @@ status_all() {
status_notify
status_imnotify
status_vmproxy
status_quota
return 0
}

Expand All @@ -927,7 +976,7 @@ test -f ${MIG_SCRIPT} || exit 0

# Force valid target
case "$2" in
script|monitor|sshmux|events|cron|janitor|transfers|openid|sftp|sftpsubsys|webdavs|ftps|notify|imnotify|vmproxy|all)
script|monitor|sshmux|events|cron|janitor|transfers|openid|sftp|sftpsubsys|webdavs|ftps|notify|imnotify|vmproxy|quota|all)
TARGET="$2"
;;
'')
Expand Down
Loading
Loading