Module: Mizuno::Daemonizer::UnixClassMethods
- Defined in:
- lib/mizuno/runner.rb
Instance Method Summary collapse
-
#setgid(options) ⇒ Object
Like setuid, but for groups.
-
#setuid(options) ⇒ Object
Switch the process over to a new user id; will abort the process if it fails.
Instance Method Details
#setgid(options) ⇒ Object
Like setuid, but for groups.
49 50 51 52 53 54 55 |
# File 'lib/mizuno/runner.rb', line 49 def setgid() entry = Etc.getgrnam([:group]) die("Can't find --group named '#{[:group]}'") \ unless entry return unless (_setgid(entry.gid) != 0) die("Can't switch to group '#{[:group]}'") end |
#setuid(options) ⇒ Object
Switch the process over to a new user id; will abort the process if it fails. options is the full list of options passed to a server.
38 39 40 41 42 43 44 |
# File 'lib/mizuno/runner.rb', line 38 def setuid() entry = Etc.getpwnam([:user]) die("Can't find --user named '#{[:user]}'") \ unless entry return unless (_setuid(entry.uid) != 0) die("Can't switch to user '#{[:user]}'") end |