source: yum/trunk/bin/yum-updatesd.py@ 6

Last change on this file since 6 was 2, checked in by Yuri Dario, 15 years ago

Initial import for vendor code.

  • Property svn:eol-style set to native
File size: 683 bytes
Line 
1#!/usr/bin/python
2import sys, os
3import optparse
4
5parser = optparse.OptionParser()
6parser.add_option("-f", "--no-fork", action="store_true", default=False, dest="nofork")
7parser.add_option("-r", "--remote-shutdown", action="store_true", default=False, dest="remoteshutdown")
8(options, args) = parser.parse_args()
9
10if not options.nofork:
11 if os.fork():
12 sys.exit()
13 fd = os.open("/dev/null", os.O_RDWR)
14 os.dup2(fd, 0)
15 os.dup2(fd, 1)
16 os.dup2(fd, 2)
17 os.close(fd)
18
19sys.path.insert(0, '/usr/share/yum-cli')
20try:
21 import yumupd
22 yumupd.main(options)
23except KeyboardInterrupt, e:
24 print >> sys.stderr, "\n\nExiting on user cancel."
25 sys.exit(1)
Note: See TracBrowser for help on using the repository browser.