Displaying 9 results from an estimated 9 matches for "write_pid_file".
2009 Feb 18
1
ssh -f & pid
...[-R [bind_address:]port:host:hostport] [-S ctl_path]\n"
" [-w local_tun[:remote_tun]] [user@]hostname [command]\n"
+" [-z pid_file]\n"
);
exit(255);
}
@@ -197,6 +201,26 @@
void muxclient(const char *);
void muxserver_listen(void);
+int write_pid_file(char *pid_file)
+{
+ char buffer[16];
+ int len;
+ int fd = open(pid_file, O_WRONLY | O_EXCL | O_CREAT, 0644);
+ if (fd == -1)
+ return -1;
+
+ len = snprintf(buffer, sizeof(buffer), "%d\n", getpid());
+ if (write(fd, buffer, len) != len)
+ {
+ close(fd);
+ return -1;
+ }
+
+ close(fd)...
2012 Jul 09
4
[PATCH 0/4] Provide guestmount --pid-file and document possible race when unmounting FUSE filesystems.
The full description of this bug is here:
https://bugzilla.redhat.com/show_bug.cgi?id=838592
and the effect it has on OpenStack is described here:
https://bugzilla.redhat.com/show_bug.cgi?id=835466#c9
Rich.
2007 Oct 05
2
Mongrel PID file permissions
...e PID files
are correctly owned by the user/group, but their permissions is 0666.
Is that normal ? Shouldn''t it be something like 0664 ?
Just curious to know if I''m wrong.
Configurator has this (line 77):
# Writes the PID file but only if we''re on windows.
def write_pid_file
if RUBY_PLATFORM !~ /mswin/
log "Writing PID file to #{@pid_file}"
open(@pid_file,"w") {|f| f.write(Process.pid) }
end
end
The comment''s wrong, and we probably need a File.chmod call there
somewhere. Should I submit a patch ?
Thanks !...
2012 Sep 04
1
[PATCH] fix fuse_opt_add_opt_escaped return type
...ion fuse_opt_add_opt_escaped has only one caller and a return
code is not checked.
Signed-off-by: Olaf Hering <olaf at aepfle.de>
---
diff --git a/fuse/guestmount.c b/fuse/guestmount.c
index 17e94ba..1eb0553 100644
--- a/fuse/guestmount.c
+++ b/fuse/guestmount.c
@@ -49,7 +49,7 @@ static int write_pid_file (const char *pid_file, pid_t pid);
* Copyright (C) 2001-2007 Miklos Szeredi <miklos at szeredi.hu>
* This [function] can be distributed under the terms of the GNU LGPLv2.
*/
-static int
+static void
fuse_opt_add_opt_escaped (char **opts, const char *opt)
{
unsigned oldlen = *opts...
2007 Mar 05
3
programatically stopping acts_as_ferret drb server
I need a way to kill the ferret_server drb process programatically, so I
can start/stop it as part of the capistrano deployment process.
This should be as simple as adding some sort of stop method to
ActsAsFerret::Remote::Server. I was just messing around and was able to
do it by modifying method_missing to look for the :stop method and then
calling DRb.thread.exit -- this is not good enough for
2007 Mar 13
18
Daemonizing a camping server
I''m having no luck trying to daemonize mongrel running a camping server.
When mongrel daemonizes, I get:
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:723:in
`accept'': closed stream (IOError)
from
/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:293:in
`join''
...
(This was after I disabled the unhandled exception catchall in the
2008 Jun 05
14
Why not ignore stale PID files?
Hi,
I have an application which is dying horrible deaths
(i.e. segmentation faults) in mid-flight, in production... And of
course, I should fix it. But while I find and fix the bugs, I found
something I think should be different - I can work on submitting a
patch, as it is quite simple, but I might be losing something on my
rationale.
When Mongrel segfaults, it does not -obviously- get to clean
2016 Aug 25
7
[PATCH 0/5] bash completion: Add missing bash completion scripts (RHBZ#1367738).
This implements most of RHBZ#1367738. I didn't bother
with virt-v2v-copy-to-local and virt-win-reg, but all the
other tools now have full bash completion.
Rich.
2016 Apr 04
2
[PATCH 1/2] Use 'error' function consistently throughout.
...+418,8 @@ main (int argc, char *argv[])
int fd;
pid = fork ();
- if (pid == -1) {
- perror ("fork");
- exit (EXIT_FAILURE);
- }
+ if (pid == -1)
+ error (EXIT_FAILURE, errno, "fork");
if (pid != 0) { /* parent */
if (write_pid_file (pid_file, pid) == -1)
@@ -434,10 +431,8 @@ main (int argc, char *argv[])
}
/* Emulate what old fuse_daemonize used to do. */
- if (setsid () == -1) {
- perror ("setsid");
- exit (EXIT_FAILURE);
- }
+ if (setsid () == -1)
+ error (EXIT_FAILURE, errno, &...