[systemd-devel] libabc, sub-objects, and reference counting
The sample libabc includes functions to get a "thing", as a sample sub-object of the overall library context. Each "thing" has a reference to the parent library context, and a function to return that reference. Given that, shouldn't abc_thing_new_from_string call abc_ref, and abc_thing_unref call abc_unref? In particular, consider a language binding for a language with garbage collection, built-in reference counting, or some other mechanism to avoid requiring explicit calls to _unref functions. The creation of a new abc context would call abc_new, and arrange to call abc_unref when the program no longer needs that abc context. Similarly, the creation of a new thing would take an abc context, call abc_thing_new_from_string (or some similar creation function), and arrange to call abc_thing_unref when the program no longer needs that thing. Code in such a language might create an abc, immediately create a thing, use the thing, and let all the now-unreferenced objects get destroyed. If "use the thing" references the thing but not the abc context, the language could decide to call abc_unref immediately after creating the thing, then use the thing, which would have a pointer to an invalid abc context. - Josh Triplett ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] fstab-generator: Allow mount.usr without mount.usrflags, honor rw/ro
There is no need to require mount.usrflags. The original implementation assumed that a btrfs subvolume would always be needed but that is not applicable to systems that do not use btrfs for /usr. Similar to using rootflags= for the default of mount.usrflags=, append the classic 'ro' and 'rw' flags to the mount options. --- src/fstab-generator/fstab-generator.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c index e8a21f7..236fb37 100644 --- a/src/fstab-generator/fstab-generator.c +++ b/src/fstab-generator/fstab-generator.c @@ -476,7 +476,7 @@ static int add_usr_mount(void) { return log_oom(); } -if (!arg_usr_what || !arg_usr_options) +if (!arg_usr_what) return 0; what = fstab_node_to_udev_node(arg_usr_what); @@ -485,7 +485,14 @@ static int add_usr_mount(void) { return -1; } -opts = arg_usr_options; +if (!arg_usr_options) +opts = arg_root_rw > 0 ? "rw" : "ro"; +else if (arg_root_rw >= 0 || + (!mount_test_option(arg_usr_options, "ro") && + !mount_test_option(arg_usr_options, "rw"))) +opts = strappenda(arg_usr_options, ",", arg_root_rw > 0 ? "rw" : "ro"); +else +opts = arg_usr_options; log_debug("Found entry what=%s where=/sysroot/usr type=%s", what, strna(arg_usr_fstype)); return add_mount(what, -- 2.0.4 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH 5/5] Remove FSF mailing address
It has changed in the past, and these days, anyone can get a copy of the LGPL via the web rather than by post. --- src/abc/libabc.h | 4 src/libabc-private.h | 4 src/libabc.c | 4 src/test-libabc.c| 4 4 files changed, 16 deletions(-) diff --git a/src/abc/libabc.h b/src/abc/libabc.h index 8924033..d33129b 100644 --- a/src/abc/libabc.h +++ b/src/abc/libabc.h @@ -12,10 +12,6 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _LIBABC_H_ diff --git a/src/libabc-private.h b/src/libabc-private.h index a76f822..7c9ad93 100644 --- a/src/libabc-private.h +++ b/src/libabc-private.h @@ -12,10 +12,6 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _LIBABC_PRIVATE_H_ diff --git a/src/libabc.c b/src/libabc.c index 23fdcd5..d6ef0b4 100644 --- a/src/libabc.c +++ b/src/libabc.c @@ -12,10 +12,6 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include diff --git a/src/test-libabc.c b/src/test-libabc.c index 6734944..9051966 100644 --- a/src/test-libabc.c +++ b/src/test-libabc.c @@ -12,10 +12,6 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along -with this program; if not, write to the Free Software Foundation, Inc., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include -- 2.1.3 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH 3/5] autogen.sh: set -e separately, rather than putting -e in the shebang line
Otherwise, if someone uses "sh autogen.sh", the -e will get ignored. --- autogen.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autogen.sh b/autogen.sh index 0d60b0a..07afd85 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,4 +1,5 @@ -#!/bin/sh -e +#!/bin/sh +set -e if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then cp -p .git/hooks/pre-commit.sample .git/hooks/pre-commit && \ -- 2.1.3 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH 4/5] m4/.gitignore: Remove stray blank line.
--- m4/.gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/m4/.gitignore b/m4/.gitignore index 8bab51c..38066dd 100644 --- a/m4/.gitignore +++ b/m4/.gitignore @@ -3,4 +3,3 @@ ltoptions.m4 ltsugar.m4 ltversion.m4 lt~obsolete.m4 - -- 2.1.3 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH 1/5] Makefile.am: Don't add abc subdirectory to include path
Source files, including those in the library itself, should include , not . --- Makefile.am | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 1ac18d0..aa53b51 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,7 +7,6 @@ AM_CPPFLAGS = \ -include $(top_builddir)/config.h \ -DSYSCONFDIR=\""$(sysconfdir)"\" \ -DLIBEXECDIR=\""$(libexecdir)"\" \ - -I${top_srcdir}/src/abc \ -I${top_srcdir}/src AM_CFLAGS = ${my_CFLAGS} \ -- 2.1.3 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH 2/5] Makefile.am: Don't define LIBEXECDIR
As README points out, the library should not execute out-of-process tools. Thus, it should never need to know LIBEXECDIR. --- Makefile.am | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index aa53b51..d7dcaed 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,7 +6,6 @@ AM_MAKEFLAGS = --no-print-directory AM_CPPFLAGS = \ -include $(top_builddir)/config.h \ -DSYSCONFDIR=\""$(sysconfdir)"\" \ - -DLIBEXECDIR=\""$(libexecdir)"\" \ -I${top_srcdir}/src AM_CFLAGS = ${my_CFLAGS} \ -- 2.1.3 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH 0/5] Enhancements to libabc template project
I went to use libabc as the basis for a new library, and found a few issues; rather than just correcting them in my own library, I'd like to push the changes back into libabc. Josh Triplett (5): Makefile.am: Don't add abc subdirectory to include path Makefile.am: Don't define LIBEXECDIR autogen.sh: set -e separately, rather than putting -e in the shebang line m4/.gitignore: Remove stray blank line. Remove FSF mailing address Makefile.am | 2 -- autogen.sh | 3 ++- m4/.gitignore| 1 - src/abc/libabc.h | 4 src/libabc-private.h | 4 src/libabc.c | 4 src/test-libabc.c| 4 7 files changed, 2 insertions(+), 20 deletions(-) -- 2.1.3 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Nspawn / getty restart loop
the container-getty@.service only needs to be present, not enabled, you can disable the unit, then the logs go away 2014-12-06 15:49 GMT+01:00 Meech : > Running Arch64 / Systemd 217. I have a barebones container initialized > with pacstrap. The conatiner is stored in /var/lib and started via systemd > (systemctl start systemd-nspawn@mycontainer) > > When nobody is logged in, the journal is spammed every 10 seconds with > agetty errors. How can I prevent this? It seems like it's in a never > ending restart loop until somebody is logged in. > > > Dec 06 00:13:53 vpn agetty[1582]: /dev/pts/0: No such file or directory > Dec 06 00:14:03 vpn systemd[1]: container-getty@0.service has no holdoff > time, scheduling restart. > Dec 06 00:14:03 vpn systemd[1]: Stopping Container Getty on /dev/pts/0... > Dec 06 00:14:03 vpn systemd[1]: Starting Container Getty on /dev/pts/0... > Dec 06 00:14:03 vpn systemd[1]: Started Container Getty on /dev/pts/0. > Dec 06 00:14:03 vpn agetty[1583]: /dev/pts/0: No such file or directory > Dec 06 00:14:13 vpn systemd[1]: container-getty@0.service has no holdoff > time, scheduling restart. > Dec 06 00:14:13 vpn systemd[1]: Stopping Container Getty on /dev/pts/0... > Dec 06 00:14:13 vpn systemd[1]: Starting Container Getty on /dev/pts/0... > Dec 06 00:14:13 vpn systemd[1]: Started Container Getty on /dev/pts/0. > > Thanks. > > ___ > systemd-devel mailing list > systemd-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/systemd-devel > ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] journal: Fix navigating backwards missing entries
Hi, I just verified that this patch also fixes https://bugs.freedesktop.org/show_bug.cgi?id=84867 . On 12/05/2014 10:06 AM, Olivier Brunel wrote: > With DIRECTION_UP (i.e. navigating backwards) in generic_array_bisect() when > the > needle was found as the last item in the array, it wasn't actually processed > as > match, resulting in entries being missed. > > https://bugs.freedesktop.org/show_bug.cgi?id=86855 > --- > This was a good excuse for me to dive in and learn about journal's internals, > but someone with actual knowledge of said internals should review this, in > case > I missed something. > > src/journal/journal-file.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c > index 7858435..c5d2d19 100644 > --- a/src/journal/journal-file.c > +++ b/src/journal/journal-file.c > @@ -1657,7 +1657,7 @@ static int generic_array_bisect( > } > } > > -if (k > n) { > +if (k >= n) { > if (direction == DIRECTION_UP) { > i = n; > subtract_one = true; > -- Kind regards, b. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] Nspawn / getty restart loop
Running Arch64 / Systemd 217. I have a barebones container initialized with pacstrap. The conatiner is stored in /var/lib and started via systemd (systemctl start systemd-nspawn@mycontainer) When nobody is logged in, the journal is spammed every 10 seconds with agetty errors. How can I prevent this? It seems like it's in a never ending restart loop until somebody is logged in. Dec 06 00:13:53 vpn agetty[1582]: /dev/pts/0: No such file or directory Dec 06 00:14:03 vpn systemd[1]: container-getty@0.service has no holdoff time, scheduling restart. Dec 06 00:14:03 vpn systemd[1]: Stopping Container Getty on /dev/pts/0... Dec 06 00:14:03 vpn systemd[1]: Starting Container Getty on /dev/pts/0... Dec 06 00:14:03 vpn systemd[1]: Started Container Getty on /dev/pts/0. Dec 06 00:14:03 vpn agetty[1583]: /dev/pts/0: No such file or directory Dec 06 00:14:13 vpn systemd[1]: container-getty@0.service has no holdoff time, scheduling restart. Dec 06 00:14:13 vpn systemd[1]: Stopping Container Getty on /dev/pts/0... Dec 06 00:14:13 vpn systemd[1]: Starting Container Getty on /dev/pts/0... Dec 06 00:14:13 vpn systemd[1]: Started Container Getty on /dev/pts/0. Thanks. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel