Projects
jsj
jsj-installtools
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 136
View file
jsj-installtools.changes
Changed
@@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Tue Jun 2 15:19:32 UTC 2026 - Stefan Botter <obs@botter.cc> + +- Add RunZypperUpdateCron.(timer|service) for periodically + running zypper up instead of doing it by cron. For > 16.0 + the systemd timer/service is configured by PrepareUpdateCrontab, + as cron is not used by default anymore. + +------------------------------------------------------------------- Thu Apr 23 08:56:37 UTC 2026 - Stefan Botter <obs@botter.cc> - change PrepareMysqlBackup to create testuser with access from
View file
jsj-installtools.spec
Changed
@@ -37,6 +37,8 @@ Source30: vhost.conf Source31: vhost-ssl.conf Source32: vhost-ssl-proxy.conf +Source33: RunZypperUpdateCron.service +Source34: RunZypperUpdateCron.timer #Requires: check_mk-agent-plugins BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -79,6 +81,7 @@ install -Dm755 %{S:15} $RPM_BUILD_ROOT/usr/bin install -Dm755 %{S:16} $RPM_BUILD_ROOT/usr/bin install -Dm755 %{S:17} $RPM_BUILD_ROOT/usr/bin +install -Dm644 %{S:33} $RPM_BUILD_ROOT/%{_unitdir} # 13.2 is 1320 and later Leap 42.1 is 1315 %if 0%{?suse_version} >= 1315 @@ -91,6 +94,18 @@ %clean rm -rf $RPM_BUILD_ROOT +%pre +%service_add_pre RunZypperUpdateCron.service RunZypperUpdateCron.timer + +%post +%service_add_post RunZypperUpdateCron.service RunZypperUpdateCron.timer + +%preun +%service_del_preun RunZypperUpdateCron.service RunZypperUpdateCron.timer + +%postun +%service_del_postun RunZypperUpdateCron.service RunZypperUpdateCron.timer + %files %defattr (-,root,root,-) %if 0%{?suse_version} >= 1210
View file
PrepareUpdateCrontab
Changed
@@ -14,8 +14,13 @@ 44 0 1 * * root rm -f /var/spool/cron/lastrun/cron.monthly EOF fi -( crontab -l; echo "$((0x$(head -c2 /dev/urandom | hexdump | awk '$2 > 0 {print $2}') % 60)) */4 * * * /usr/share/jsjinstalltools/RunZypperUpdateCron" ) | \ - egrep -v "^#" | crontab - +if ${VERION_IP/./} -ge 160 ; then + systemctl enable RunZypperUpdateCron.timer + systemctl start RunZypperUpdateCron.timer +else + ( crontab -l; echo "$((0x$(head -c2 /dev/urandom | hexdump | awk '$2 > 0 {print $2}') % 60)) */4 * * * /usr/share/jsjinstalltools/RunZypperUpdateCron" ) | \ + egrep -v "^#" | crontab - +fi if ${VERSION_ID/./} -eq 423 || (( ${VERSION_ID/./} -ge 132 && ${VERSION_ID/./} -lt 421 )) ; then sed -i -e '/^AccuracySec/ s/=.*$/=1min/' /usr/lib/systemd/system/logrotate.timer systemctl enable logrotate.timer
View file
RunZypperUpdateCron.service
Added
@@ -0,0 +1,26 @@ +Unit +Description=periodically run zypper up + +Service +Type=oneshot +ExecStart=/usr/share/jsj-installtools/RunZypperUpdateCron + +# hardening options +# details: https://www.freedesktop.org/software/systemd/man/systemd.exec.html +# no ProtectHome for userdir logs +# no PrivateNetwork for mail deliviery +# no NoNewPrivileges for third party rotate scripts +# no RestrictSUIDSGID for creating setgid directories +LockPersonality=true +MemoryDenyWriteExecute=true +PrivateDevices=true +PrivateTmp=true +ProtectClock=true +ProtectControlGroups=true +ProtectHostname=true +ProtectKernelLogs=true +ProtectKernelModules=true +ProtectKernelTunables=true +ProtectSystem=full +RestrictNamespaces=true +RestrictRealtime=true
View file
RunZypperUpdateCron.timer
Added
@@ -0,0 +1,10 @@ +Unit +Description=periodically run zypper up + +Timer +OnCalendar=4h +RandomizedDelaySec=1h +Persistent=true + +Install +WantedBy=timers.target
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.