util/prosodyctl.lua

changeset 2457
102c81e37878
parent 2446
62aa1b465e05
child 2925
692b3c6c5bd2
equal deleted inserted replaced
2456:260601859c9f 2457:102c81e37878
63 local pidfile = config.get("*", "core", "pidfile"); 63 local pidfile = config.get("*", "core", "pidfile");
64 if not pidfile then 64 if not pidfile then
65 return false, "no-pidfile"; 65 return false, "no-pidfile";
66 end 66 end
67 67
68 local file, err = io.open(pidfile, "w"); 68 local file, err = io.open(pidfile, "r+");
69 if not file then 69 if not file then
70 return false, "pidfile-read-failed", err; 70 return false, "pidfile-read-failed", err;
71 end 71 end
72 72
73 local locked, err = lfs.lock(file, "w"); 73 local locked, err = lfs.lock(file, "w");

mercurial