summaryrefslogtreecommitdiff
path: root/rhnop-server/noprml
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2011-04-02 16:03:14 (GMT)
committerChristian Pointner <equinox@helsinki.at>2011-04-02 16:03:14 (GMT)
commit96889f1baf748b33f65398c79c03b439eaa0f3ef (patch)
tree7a6941dc54ca23997f4b3504fcd3882ccd2a8a9e /rhnop-server/noprml
parent5524ae404ffb897ca60162819502e4a9bd7d9599 (diff)
fixed runit script
added log service to runit switched to microseconds for timestamps
Diffstat (limited to 'rhnop-server/noprml')
-rwxr-xr-xrhnop-server/noprml8
1 files changed, 4 insertions, 4 deletions
diff --git a/rhnop-server/noprml b/rhnop-server/noprml
index 6065948..a763de3 100755
--- a/rhnop-server/noprml
+++ b/rhnop-server/noprml
@@ -27,15 +27,12 @@
local queue_name = "/rhnop"
-require "posix"
-mq = require "mq"
-
-- reading timestamp (milliseconds since epoch)
local p = assert(io.popen("/bin/date --utc '+%s %N'" , 'r'))
local time = assert(p:read('*l'))
p:close()
local s, ns = assert(string.match(time, "([0-9]+) ([0-9]+)"))
-local timestamp = s*1000 + math.floor(ns/1000000)
+local timestamp = s .. string.format("%06d", math.floor(ns/1000))
-- check arguments
if #arg < 4 then
@@ -43,6 +40,9 @@ if #arg < 4 then
os.exit(1)
end
+require "posix"
+mq = require "mq"
+
-- open message queue
posix.umask("rwxrwxr-x")
local q, err = mq.create(queue_name, "wo", "rw-rw----")