package.py 568 B

123456789101112131415161718192021222324
  1. #!/usr/bin/python
  2. import os, re
  3. OUR_NAME = "docker"
  4. OUR_DESC = "docker"
  5. logfile = "/var/log/docker.log"
  6. def postInstall(fromVersion, fromRelease, toVersion, toRelease):
  7. try:
  8. os.system("/usr/sbin/groupadd %s" % OUR_NAME)
  9. os.system("usermod -a -G docker %s" % os.getusername())
  10. os.system("/bin/touch %s" % logfile)
  11. os.system("/bin/chown root:docker %s" % logfile)
  12. os.system("chmod 0644 %s" % logfile)
  13. except:
  14. pass
  15. def preRemove():
  16. try:
  17. os.system ("groupdel %s" % OUR_NAME)
  18. except:
  19. pass