Re: [systemd-devel] Error: inappropriate ioctl stty standard input
2011/6/28 Stef Bon stef...@gmail.com: 2011/6/27 Lennart Poettering lenn...@poettering.net: On Sat, 25.06.11 21:57, Stef Bon (stef...@gmail.com) wrote: Hi, I've been able to make my shiny new LFS system boot using systemd, but still with errors. When the tty's are activated, Iget the message: stty: standard input: Inappropriate ioctl for device This usually indicates that your standard input in this shell is not actually a tty, but some other kind of fd. By doing readlink /proc/self/fd/0 you might be able to find out what your stdin is connected to. Well, Ive been playing around with the kernel, I guess I had not selected the right options. I'm able to login after 6 seconds, in my Shutle Barebone, on a normal SATA harddisk. BUt still, after all the logmessages, there does not seem to happen anything, but when I do a newline, there appears the login. When I do something else, like a character and then enter, the password prompt appears. So the login is present, but not visible. I already see that the login appears, but that is overwritten by messages about bringing up tty and the network, which is a rc.d script. I thought it wat the getty prorgram, I've already swiched to mingetty, which by default clears the screen, but that did not help. I've also been playing around with logtarget=syslog, or console or null, it does not change. I added the option quiet to the kernel commandline, and now it's fine. But now all the messages dissapeared. I still would like to see messages, about the network being activated etc.. Stef ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [HEADSUP] We no longer spawn 6 gettys by default
Hi, I think it's ok to only activate the getty programs on demand. Maybe use only mingetty?? Who works on the serial line these days? mingetty is faster I would like to add the following: I had some trouble with logmessages on my screen while the login is there already. This has probably something to do with the asynchronous behaviour of the system startup systemd does. Now to make these messages go away not polluting my login screen, I added the quiet option on the kernel commandline. This worked, and the login is there in about 3seconds! BUt I still would like to see the logmessages somewhere, like the network coming up, and what ip assigned etc. Isn't it a nice thing to have one tty assigned to be a logconsole, ie no login there, but logmessages? Stef ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH 1/2] systemd-nspawn: add --user option
Move the get_user_creds from execute.c to utils.c for later usage in nspawn.c. --- src/execute.c | 46 -- src/util.c| 47 +++ src/util.h|2 ++ 3 files changed, 49 insertions(+), 46 deletions(-) diff --git a/src/execute.c b/src/execute.c index b00ccde..912f2ce 100644 --- a/src/execute.c +++ b/src/execute.c @@ -579,52 +579,6 @@ static int get_group_creds(const char *groupname, gid_t *gid) { return 0; } -static int get_user_creds(const char **username, uid_t *uid, gid_t *gid, const char **home) { -struct passwd *p; -unsigned long lu; - -assert(username); -assert(*username); -assert(uid); -assert(gid); -assert(home); - -/* We enforce some special rules for uid=0: in order to avoid - * NSS lookups for root we hardcode its data. */ - -if (streq(*username, root) || streq(*username, 0)) { -*username = root; -*uid = 0; -*gid = 0; -*home = /root; -return 0; -} - -if (safe_atolu(*username, lu) = 0) { -errno = 0; -p = getpwuid((uid_t) lu); - -/* If there are multiple users with the same id, make - * sure to leave $USER to the configured value instead - * of the first occurrence in the database. However if - * the uid was configured by a numeric uid, then let's - * pick the real username from /etc/passwd. */ -if (*username p) -*username = p-pw_name; -} else { -errno = 0; -p = getpwnam(*username); -} - -if (!p) -return errno != 0 ? -errno : -ESRCH; - -*uid = p-pw_uid; -*gid = p-pw_gid; -*home = p-pw_dir; -return 0; -} - static int enforce_groups(const ExecContext *context, const char *username, gid_t gid) { bool keep_groups = false; int r; diff --git a/src/util.c b/src/util.c index 278f018..d3875a5 100644 --- a/src/util.c +++ b/src/util.c @@ -5164,6 +5164,53 @@ int socket_from_display(const char *display, char **path) { return 0; } +int get_user_creds(const char **username, uid_t *uid, gid_t *gid, const char **home) { +struct passwd *p; +unsigned long lu; + +assert(username); +assert(*username); +assert(uid); +assert(gid); +assert(home); + +/* We enforce some special rules for uid=0: in order to avoid + * NSS lookups for root we hardcode its data. */ + +if (streq(*username, root) || streq(*username, 0)) { +*username = root; +*uid = 0; +*gid = 0; +*home = /root; +return 0; +} + +if (safe_atolu(*username, lu) = 0) { +errno = 0; +p = getpwuid((uid_t) lu); + +/* If there are multiple users with the same id, make + * sure to leave $USER to the configured value instead + * of the first occurrence in the database. However if + * the uid was configured by a numeric uid, then let's + * pick the real username from /etc/passwd. */ +if (*username p) +*username = p-pw_name; +} else { +errno = 0; +p = getpwnam(*username); +} + +if (!p) +return errno != 0 ? -errno : -ESRCH; + +*uid = p-pw_uid; +*gid = p-pw_gid; +*home = p-pw_dir; +return 0; +} + + static const char *const ioprio_class_table[] = { [IOPRIO_CLASS_NONE] = none, [IOPRIO_CLASS_RT] = realtime, diff --git a/src/util.h b/src/util.h index a26fb6f..e9f0567 100644 --- a/src/util.h +++ b/src/util.h @@ -477,4 +477,6 @@ int signal_from_string(const char *s); int signal_from_string_try_harder(const char *s); +int get_user_creds(const char **username, uid_t *uid, gid_t *gid, const char **home); + #endif -- 1.7.4.1 pgpxcvCVHdzZt.pgp Description: PGP signature ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [HEADSUP] We no longer spawn 6 gettys by default
On Wed, Jun 29, 2011 at 11:15:02AM +0200, Stef Bon wrote: I think it's ok to only activate the getty programs on demand. Maybe use only mingetty?? Who works on the serial line these days? The embedded folks. rsc -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0| Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917- | ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [HEADSUP] We no longer spawn 6 gettys by default
Op 29 jun 2011, om 14:37 heeft Robert Schwebel het volgende geschreven: On Wed, Jun 29, 2011 at 11:15:02AM +0200, Stef Bon wrote: I think it's ok to only activate the getty programs on demand. Maybe use only mingetty?? Who works on the serial line these days? The embedded folks. Indeed! The first thing I did with systemd was to get serial console working :) ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [HEADSUP] We no longer spawn 6 gettys by default
On 29/06/11 13:45, Koen Kooi wrote: Op 29 jun 2011, om 14:37 heeft Robert Schwebel het volgende geschreven: On Wed, Jun 29, 2011 at 11:15:02AM +0200, Stef Bon wrote: I think it's ok to only activate the getty programs on demand. Maybe use only mingetty?? Who works on the serial line these days? The embedded folks. Indeed! The first thing I did with systemd was to get serial console working :) Same here. Serial console is really *critical* in the embedded world. Chris ___ 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] [HEADSUP] We no longer spawn 6 gettys by default
On Wed, Jun 29, 2011 at 14:54, Christian Gagneraud ch...@techworks.ie wrote: On 29/06/11 13:45, Koen Kooi wrote: Op 29 jun 2011, om 14:37 heeft Robert Schwebel het volgende geschreven: On Wed, Jun 29, 2011 at 11:15:02AM +0200, Stef Bon wrote: I think it's ok to only activate the getty programs on demand. Maybe use only mingetty?? Who works on the serial line these days? The embedded folks. Indeed! The first thing I did with systemd was to get serial console working :) Same here. Serial console is really *critical* in the embedded world. No worry, systemd standardized on util-linux's agetty for all getty uses. Agetty even got some features merged from mingetty recently. Mingetty is not used and there is no plan to do so in systemd's default setup. People are free to replace the default with their own service files locally though. Kay ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [HEADSUP] We no longer spawn 6 gettys by default
On Wed, 29.06.11 11:15, Stef Bon (stef...@gmail.com) wrote: Hi, I think it's ok to only activate the getty programs on demand. Maybe use only mingetty?? We gently try to push everybody to standardize on util-linux' agetty. There is no point in maintaining multiple mostly equivalent getty implementations. Also, as it turns out while mingetty uses less disk space than agetty it uses more runtime memory. The few features mingetty had that agetty didn't have have now been added to util-linux, and hence mingetty should be considered fully obsolete. Lennart -- Lennart Poettering - Red Hat, Inc. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Error: inappropriate ioctl stty standard input
On Tue, 28.06.11 20:43, Stef Bon (stef...@gmail.com) wrote: 2011/6/27 Lennart Poettering lenn...@poettering.net: On Sat, 25.06.11 21:57, Stef Bon (stef...@gmail.com) wrote: Hi, I've been able to make my shiny new LFS system boot using systemd, but still with errors. When the tty's are activated, Iget the message: stty: standard input: Inappropriate ioctl for device This usually indicates that your standard input in this shell is not actually a tty, but some other kind of fd. By doing readlink /proc/self/fd/0 you might be able to find out what your stdin is connected to. Well, Ive been playing around with the kernel, I guess I had not selected the right options. I'm able to login after 6 seconds, in my Shutle Barebone, on a normal SATA harddisk. BUt still, after all the logmessages, there does not seem to happen anything, but when I do a newline, there appears the login. When I do something else, like a character and then enter, the password prompt appears. So the login is present, but not visible. I already see that the login appears, but that is overwritten by messages about bringing up tty and the network, which is a rc.d script. I thought it wat the getty prorgram, I've already swiched to mingetty, which by default clears the screen, but that did not help. I've also been playing around with logtarget=syslog, or console or null, it does not change. As you noticed we spawn the gettys much earlier on systemd than they have traditionally been started. This might cause output to be mixed out. By using quiet or even a boot splash like Plymouth you can avoid the confusing mix up of service status messages and the getty prompt. Lennart -- Lennart Poettering - Red Hat, Inc. ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [HEADSUP] We no longer spawn 6 gettys by default
Ok, I did not expect this. Ok, stupid idea, forget it. But what about the log console, redirecting log to one of the virtual consoles, reachable via alt-fx? Stef ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [HEADSUP] We no longer spawn 6 gettys by default
On Wed, Jun 29, 2011 at 5:37 AM, Robert Schwebel r.schwe...@pengutronix.de wrote: On Wed, Jun 29, 2011 at 11:15:02AM +0200, Stef Bon wrote: I think it's ok to only activate the getty programs on demand. Maybe use only mingetty?? Who works on the serial line these days? The embedded folks. *raises hands* And I don't even consider myself embedded :) Auke ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel