[systemd-devel] [PATCH 4/4] README: Check for libudev-160, as in configure.ac

2010-10-06 Thread fidencio
From: Fabiano Fidencio --- README |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/README b/README index 430d091..12dc9fe 100644 --- a/README +++ b/README @@ -28,7 +28,7 @@ AUTHOR: REQUIREMENTS: Linux kernel >= 2.6.30 (with autofs4, devtmpfs, cgroups) -

[systemd-devel] [PATCH 3/4] Adding binary to shutdown the system

2010-10-06 Thread fidencio
From: Fabiano Fidencio This functions are working as follows: - Send a SIGTERM to all processes that may be finished - Send a SIGKILL to all processes that still live and may be finished - Try to unmount all mount points - Try to remount read-only all mount points that can't be umount

[systemd-devel] [PATCH 2/4] Adding unmount functions to be used in shutdown

2010-10-06 Thread fidencio
From: Fabiano Fidencio This functions will: - umount all mount points that aren't API - remount read-only all mount points that can't be umounted - umount all swap devices. - detach all loopback devices TODO: - umount dms Mountpoints are being read from /proc/self/mountinfo. Swap

[systemd-devel] [PATCH 1/4] Adding a strneq, to represent (!strncmp(a, b, n))

2010-10-06 Thread fidencio
From: Fabiano Fidencio As we have streq to repesent (strcmp(a, b) == 0),I'm adding strneq to represent (strncmp(a, b, n) == 0), that will be used in umount.c (at least). --- src/util.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/util.h b/src/util.h index f21aecf.

[systemd-devel] [PATCH 2/2] Adding binary to shutdown the system

2010-10-06 Thread Gustavo Sverzut Barbieri
From: Fabiano Fidencio This functions are working as follows: - Send a SIGTERM to all processes that may be finished - Send a SIGKILL to all processes that still live and may be finished - Try to unmount all mount points - Try to remount read-only all mount points that can't be um

[systemd-devel] [PATCH 1/2] Adding unmount functions to be used in shutdown

2010-10-06 Thread Gustavo Sverzut Barbieri
From: Fabiano Fidencio This functions will: - umount all mount points that aren't API - remount read-only all mount points that can't be umounted - umount all swap devices. - detach all loopback devices TODO: - umount dms Mountpoints are being read from /proc/self/mountinfo.

Re: [systemd-devel] [PATCH 1/2] Adding unmount functions to be used in shutdown

2010-10-06 Thread Gustavo Sverzut Barbieri
On Wed, Oct 6, 2010 at 10:40 AM, Gustavo Sverzut Barbieri wrote: >>> +        ioctl(fd, LOOP_CLR_FD, 0); >>> +        r = errno; >>> +        close_nointr(fd); >>> + >>> +        if (r == ENXIO) /* not bound, so no error */ >>> +                r = 0; >>> +        errno = r; >>> +        return -e

Re: [systemd-devel] [PATCH 1/2] Adding unmount functions to be used in shutdown

2010-10-06 Thread Karel Zak
On Wed, Oct 06, 2010 at 03:01:02PM +0200, Lennart Poettering wrote: > > > +if (streq(mp->path, "/")) > > > +continue; > > > + > > > +/* Trying to umount. Forcing to umount if busy (only for > > > NFS mounts) */ > > > +if (umou

Re: [systemd-devel] [PATCH 1/2] Adding unmount functions to be used in shutdown

2010-10-06 Thread Gustavo Sverzut Barbieri
On Wed, Oct 6, 2010 at 10:09 AM, Lennart Poettering wrote: > On Wed, 06.10.10 02:05, Gustavo Sverzut Barbieri (barbi...@profusion.mobi) > wrote: > >> +#define LOOP_CLR_FD     0x4C01 > > Is there any particular reason you define this here? To me it appears > that linux/loop.h is perfectly fit to b

Re: [systemd-devel] [PATCH 1/2] Adding unmount functions to be used in shutdown

2010-10-06 Thread Kay Sievers
On Wed, Oct 6, 2010 at 15:09, Lennart Poettering wrote: > On Wed, 06.10.10 02:05, Gustavo Sverzut Barbieri (barbi...@profusion.mobi) > wrote: > >> +#define LOOP_CLR_FD     0x4C01 > > Is there any particular reason you define this here? To me it appears > that linux/loop.h is perfectly fit to be i

Re: [systemd-devel] [PATCH 2/2] Adding binary to shutdown the system

2010-10-06 Thread Lennart Poettering
On Wed, 06.10.10 02:05, Gustavo Sverzut Barbieri (barbi...@profusion.mobi) wrote: > +static int send_signal(int sign) { > +sigset_t mask, oldmask; > +usec_t until; > +int processes; > +struct timespec ts; > + > +sigemptyset(&mask); Minor nitpick: I tend to

Re: [systemd-devel] [PATCH 1/2] Adding unmount functions to be used in shutdown

2010-10-06 Thread Lennart Poettering
On Wed, 06.10.10 02:05, Gustavo Sverzut Barbieri (barbi...@profusion.mobi) wrote: > +#define LOOP_CLR_FD 0x4C01 Is there any particular reason you define this here? To me it appears that linux/loop.h is perfectly fit to be included here. > + > +if ((dir = opendir("/sys/class/block")

Re: [systemd-devel] [PATCH 1/2] Adding unmount functions to be used in shutdown

2010-10-06 Thread Lennart Poettering
On Wed, 06.10.10 14:17, Karel Zak (k...@redhat.com) wrote: > > +static int mount_points_list_umount(MountPoint **mount_point_list_head) { > > +MountPoint *mp, *mp_next; > > +int failed = 0; > > + > > +LIST_FOREACH_SAFE(mount_point, mp, mp_next, > > *mount_point_list_head)

Re: [systemd-devel] [PATCH 2/2] Adding binary to shutdown the system

2010-10-06 Thread Lennart Poettering
On Wed, 06.10.10 14:25, Karel Zak (k...@redhat.com) wrote: > > +if (need_swapoff) { > > +log_info("Disabling Swaps"); > > +r = swapoff_all(); > > +if (r == 0) > > +need_swapoff =

Re: [systemd-devel] [PATCH 1/2] Adding unmount functions to be used in shutdown

2010-10-06 Thread Kay Sievers
On Wed, Oct 6, 2010 at 14:17, Karel Zak wrote: >> +        if ((dir = opendir("/sys/class/block")) == NULL) >> +                return -errno; >> + >> +        while ((d = readdir(dir))) { >> +                MountPoint *lb; >> +                char buf[PATH_MAX]; >> +                char *loop; >

Re: [systemd-devel] [PATCH 2/2] Adding binary to shutdown the system

2010-10-06 Thread Karel Zak
On Wed, Oct 06, 2010 at 02:05:44AM -0300, Gustavo Sverzut Barbieri wrote: > +/* umount all mountpoints, swaps, and loopback devices */ > +retries = FINALIZE_ATTEMPTS; > +while (need_umount || need_swapoff || need_loop_detach) { > +if (need_umount) { > +

Re: [systemd-devel] [PATCH 1/2] Adding unmount functions to be used in shutdown

2010-10-06 Thread Karel Zak
On Wed, Oct 06, 2010 at 02:05:43AM -0300, Gustavo Sverzut Barbieri wrote: > +static int swap_list_get(MountPoint **swap_list_head) { > +FILE *proc_swaps; > +unsigned int i; > +int r; > + > +if (!(proc_swaps = fopen("/proc/swaps", "re"))) > +return -er