Commit Graph

4757 Commits

Author SHA1 Message Date
Petr Uzel bbe289c489 uuidd: implement --socket-activation option
Implement --socket-activation option, which is supposed to be used
with systemd (or equivalent init system) socket activation mechanism.
With this option, the UUID daemon does not create the socket on its own,
but instead expect the connection fd to be provided by the calling
process.

This option is only available if util-linux is configured with
--enable-socket-activation option. With this configure
option, the uuidd is compiled with sd-daemon.c.

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-04 15:14:04 +02:00
Petr Uzel 75a94e8b36 uuidd: factor out socket creation into separate function
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-04 15:13:46 +02:00
Petr Uzel e1cf3ebed5 uuidd: implement --no-fork option
With this option, uuidd does not daemonize itself but stays
in the foreground.

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-04 15:13:45 +02:00
Petr Uzel f6f3dc7811 uuidd: use ignore_result helper
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-04 15:13:43 +02:00
Petr Uzel 0abfbd9ce6 uuidd: implement --no-pid option
With this option, uuidd does not create the PID file.

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-04 15:13:40 +02:00
Petr Uzel c453635572 uuidd: factor out pidfile creation into separate function
Introduce create_pidfile() function.

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-04 15:13:34 +02:00
Petr Uzel fcb09bf211 uuidd: remove useless initialization of cleanup_socket
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-04 15:13:28 +02:00
Petr Uzel 2e9b39eff3 uuidd: use UUIDD_OP_GETPID instead of magic number
Make parameters passed to call_daemon() more descriptive:
- use UUIDD_OP_GETPID instead of magic number 0
- call_daemon() takes pointer as a last argument, so pass NULL instead
  of 0

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-05-04 15:13:20 +02:00
Vladimir 'φ-coder/phcoder' Serbinenko a767169feb libblkid: support UFS UUID
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-04 11:49:16 +02:00
Vladimir 'φ-coder/phcoder' Serbinenko fd688b6cf3 libblkid: accept small blocks for NTFS and Reiserfs in blkid
libblkid is restrictive as to what it accepts as valid reiserfs or
valid NTFS.  One can mkfs an NTFS with 256B sectors and it's supported
by ntfs-3g Reiserfs can have 512B blocks and it works both with
mkfs.ntfs and Linux.

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-04 11:48:07 +02:00
Karel Zak 5b0289b9cf build-sys: add BUILD_WDCTL, check for linux/watchdog.h
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-04 11:45:35 +02:00
Karel Zak 013a48910e wdctl: add man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-04 11:04:35 +02:00
Karel Zak 3dd00e0773 wdctl: make timeouts output more parsable
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-04 11:02:47 +02:00
Karel Zak 09f9a393a4 wdctl: rewrite to use lib/tt
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-03 17:29:31 +02:00
Karel Zak 5ef167714e lib/strutils: add string_to_bitmask()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-03 17:28:44 +02:00
Karel Zak 1ea962b208 lsblk: fix /sys/.../ro usage
Reported-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-03 16:24:12 +02:00
Karel Zak 0bda832322 lslock: remove duplicate variable
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-03 16:01:04 +02:00
Karel Zak 4a695b1a8b include/tt: remove obsolete stuff
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-03 15:25:23 +02:00
Sami Kerola 33a0de92e9 wdctl: align with other util-linux commands
* Add watchdog device path to pathnames.h
* Check output stream status at exit.
* Adjust usage() notation to follow howto file.
* Retire numeric return value.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-05-03 15:00:07 +02:00
Karel Zak 96f817fb16 fdisk: fix fdiskdoslabel.c global variables
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-05-02 14:05:51 +02:00
Davidlohr Bueso e2ee917804 fdisk: isolate dos label logic
DOS specific logic is currently embedded in the heart of fdisk code. This patch
separates DOS label specific code into its own file, just like the rest of the
labels, leaving a more generic fdisk.c file. Most changes are just moving code
from fdisk.c to fdisk.h and fdiskdoslabel.[c/h].

The only logical modification is calling dos_delete_partition() from
read_extended(), instead of the generic delete_partition.  This is ok since
read extended is only called from a DOS context.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-05-02 10:35:57 +02:00
Karel Zak 1f13d6fcd0 Merge branch '2012wk17' of https://github.com/kerolasa/lelux-utiliteetit
* '2012wk17' of https://github.com/kerolasa/lelux-utiliteetit:
  build-sys: determine availability of __fpending()
2012-05-02 09:34:39 +02:00
Davidlohr Bueso 64115eed34 fdisk: remove dummy function
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-05-02 09:33:56 +02:00
Davidlohr Bueso 3457420178 fdisk: rework fatal errors
When the device cannot be opened, there's no point calling fatal() when we can
just use err(3). When any other kind of fatal error occurs it's Ok, in addition
we can also go ahead and close the descriptor before exiting the program as
it's currently leaking.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-05-02 09:33:46 +02:00
Davidlohr Bueso 337643ad0f fdisk: remove listing variable
useless global variable.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-05-02 09:33:32 +02:00
Davidlohr Bueso 9f6c866f65 fdisk: remove stack jumping
This patch eliminates the long/setjmp code. The current logic does not do
anything with stack jumps as it only exits from
print_partition_table_from_option() when a fatal error occurs.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-05-02 09:33:24 +02:00
Karel Zak 4bfd4bffb7 findmnt: restrict within-device matching
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-27 14:06:20 +02:00
Bernhard Voelker 80d7a31374 docs: fix further typos found by misspellings
Additionally to the fixes in commit v2.21-325-g455fe9a,
fix typos in release notes and NEWS.

Signed-off-by: Bernhard Voelker <mail@...>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-27 12:44:26 +02:00
Petr Uzel 6901f22ce0 findmnt: fix compiler warnings [-Wuninitialized]
findmnt.c:333:29: error: ‘vfs_attr’ may be used uninitialized in this function [-Werror=uninitialized]
findmnt.c:307:11: note: ‘vfs_attr’ was declared here

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-04-27 12:30:51 +02:00
Petr Uzel 077fdcdb2a sfdisk: fix compiler warning [-Wunused-result]
sfdisk.c: In function ‘do_fdisk’:
sfdisk.c:3212:11: error: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-04-27 12:30:49 +02:00
Petr Uzel 28d4cdcb9d fsck.minix.c: fix compiler warnings [-Wunused-result]
fsck.minix.c: In function ‘ask’:
fsck.minix.c:263:7: error: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-04-27 12:30:46 +02:00
Petr Uzel e584fa80d7 libuuid: fix typo in uuid_compare manpage
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-04-27 12:30:42 +02:00
Petr Uzel e958346805 build-sys: add fsprobe.h to dist
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-04-27 12:30:40 +02:00
Petr Uzel b3f807e13f build-sys: add swapon-common.h to swapon sources (fix distcheck)
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-04-27 12:30:39 +02:00
Petr Uzel 7f64f9bde7 build-sys: add ttyutils.h to dist
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-04-27 12:30:37 +02:00
Petr Uzel 95c46edd67 build-sys: add randutils.h to dist
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-04-27 12:30:34 +02:00
Petr Uzel a2defd027f build-sys: run distcheck with verbose make rules
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2012-04-27 12:30:22 +02:00
Karel Zak 6257e44582 libmount: close device fd (to avoid mount(2) EBUSY)
libmount uses libblkid to detect filesystem type. Unfortunately, the
blkid probe struct is not freed before mount(2), it means that the
device is still open and mount(2) may return EBUSY.

We don't need persistent blkid stuff in libmount, so let's close
all immediately after device probing.

Reported-by: David Zeuthen <zeuthen@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-27 10:30:08 +02:00
Dave Reisner b215d8e9a7 findmnt: add match_by_file to do within-device matching
Use the newly exported mnt_get_mountpoint to determine the device that a
given file resides on, in case the supplied source or target is not
explicitly a mount point.

http://www.spinics.net/lists/util-linux-ng/msg06081.html

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-26 09:38:07 +02:00
Dave Reisner cd3d6c5bd0 libmount: expose mnt_get_mountpoint as external API 2012-04-26 09:38:02 +02:00
Karel Zak f6efe5024c lib/tt: check for non-printable chars for raw/export format
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-26 09:28:44 +02:00
Karel Zak f8bb6246fd lib/tt: encode data for RAW and EXPORT format
* all tt based utils will properly encode blank chars for raw output
   format and quotes for export output format

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-26 09:22:19 +02:00
Karel Zak d324270eee lsblk: remove private \x<hex> coding, decode data from udev
* remove private encoding code (all encoding will be in lib/tt.c)
 * decode LABELs from udev

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-26 09:20:47 +02:00
Karel Zak 4644638fe8 findmnt: add note about \x<hex> to man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-26 09:19:07 +02:00
Karel Zak 95387b6696 lib/mangle: cleanup, add unhexmangle
* use strchr() rather than for()
 * small refactoring in mangle code
 * add un-hex-mangle

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-26 09:17:44 +02:00
Karel Zak cd49218679 findmnt: add support for maj:min source
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-25 09:51:26 +02:00
Karel Zak 677ff053f6 libmount: add mnt_table_find_devno()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-25 09:49:50 +02:00
Karel Zak 54a3d5eeec libmount: fix mnt_context_guess_fstype()
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-25 09:05:24 +02:00
Karel Zak ba24923e97 mount: (new) use MNT_ERR_ for error messages
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-24 11:59:18 +02:00
Karel Zak 47dea49b4c libmount: add special MNT_ERR_ codes
... to detect some situations where standard -errno is too generic.

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-04-24 11:57:32 +02:00