package.py 536 B

12345678910111213141516
  1. #!/usr/bin/python
  2. import os
  3. def postInstall(fromVersion, fromRelease, toVersion, toRelease):
  4. ugstr = "root:utmp"
  5. os.spawnvp(os.P_NOWAIT, "/bin/chown", ["/bin/chown", ugstr, "/usr/sbin/utempter"])
  6. os.spawnvp(os.P_NOWAIT, "/bin/chmod", ["/bin/chmod", "2775", "/usr/sbin/utempter"])
  7. for file in ["/var/log/wtmp", "/run/utmp"]:
  8. if os.path.exists(file):
  9. os.spawnvp(os.P_NOWAIT, "/bin/chown", ["/bin/chown", ugstr, file])
  10. os.spawnvp(os.P_NOWAIT, "/bin/chmod", ["/bin/chmod", "664", file])