Server IP : 13.213.54.232 / Your IP : 216.73.216.72 Web Server : Apache/2.4.52 (Ubuntu) System : Linux ip-172-31-17-110 6.8.0-1029-aws #31~22.04.1-Ubuntu SMP Thu Apr 24 21:16:18 UTC 2025 x86_64 User : www-data ( 33) PHP Version : 7.1.33-67+ubuntu22.04.1+deb.sury.org+1 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /proc/self/root/lib/systemd/scripts/ |
Upload File : |
#!/bin/sh set -ue CONF="/etc/default/chrony" DOC="/usr/share/doc/chrony/README.container" CAP="cap_sys_time" CMD="/usr/sbin/chronyd" # Take any args passed, use none if nothing was specified EFFECTIVE_DAEMON_OPTS=${@:-""} if [ -f "${CONF}" ]; then . "${CONF}" else echo "<4>Warning: ${CONF} is missing" fi # take from conffile if available, default to no otherwise EFFECTIVE_SYNC_IN_CONTAINER=${SYNC_IN_CONTAINER:-"no"} if [ ! -x "${CMD}" ]; then echo "<3>Error: ${CMD} not executable" # ugly, but works around https://github.com/systemd/systemd/issues/2913 sleep 0.1 exit 1 fi # Check if -x is already set manually, don't process further if that is the case X_SET=0 for arg in $@; do if echo "$arg" | grep -q -e '^-[a-zA-Z0-9]*x'; then X_SET=1 fi done if [ ${X_SET} -ne 1 ]; then # Assume it is not in a container IS_CONTAINER=0 if [ -x /usr/bin/systemd-detect-virt ]; then if /usr/bin/systemd-detect-virt --quiet --container; then IS_CONTAINER=1 fi fi # Assume it has the cap HAS_CAP=1 CAPSH="/sbin/capsh" if [ -x "${CAPSH}" ]; then ${CAPSH} --has-p="${CAP}" || HAS_CAP=0 fi if [ ${HAS_CAP} -eq 0 ]; then echo "<4>Warning: Missing ${CAP}, syncing the system clock will fail" fi if [ ${IS_CONTAINER} -eq 1 ]; then echo "<4>Warning: Running in a container, likely impossible and unintended to sync system clock" fi if [ ${HAS_CAP} -eq 0 -o ${IS_CONTAINER} -eq 1 ]; then if [ "${EFFECTIVE_SYNC_IN_CONTAINER}" != "yes" ]; then echo "<5>Adding -x as fallback disabling control of the system clock, see ${DOC} to override this behavior" EFFECTIVE_DAEMON_OPTS="${EFFECTIVE_DAEMON_OPTS} -x" else echo "<5>Not falling back to disable control of the system clock, see ${DOC} to change this behavior" fi fi fi ${CMD} ${EFFECTIVE_DAEMON_OPTS}