lib/eye/process/validate.rb in reel-eye-0.3.1 vs lib/eye/process/validate.rb in reel-eye-0.3.2
- old
+ new
@@ -1,6 +1,7 @@
require 'shellwords'
+require 'etc'
module Eye::Process::Validate
class Error < Exception; end
@@ -16,8 +17,15 @@
end
end
Shellwords.shellwords(config[:stop_command]) if config[:stop_command]
Shellwords.shellwords(config[:restart_command]) if config[:restart_command]
+
+ Etc.getpwnam(config[:uid]) if config[:uid]
+ Etc.getpwnam(config[:gid]) if config[:gid]
+
+ if config[:working_dir]
+ raise Error, "working_dir '#{config[:working_dir]}' is invalid" unless File.directory?(config[:working_dir])
+ end
end
-end
\ No newline at end of file
+end