[systemd-devel] [PATCH] zsh completion: add _kernel-install
--- Makefile.am | 1 + shell-completion/zsh/_kernel-install | 26 ++ 2 files changed, 27 insertions(+) create mode 100644 shell-completion/zsh/_kernel-install diff --git a/Makefile.am b/Makefile.am index 8e64aaa..1b55c66 100644 --- a/Makefile.am +++ b/Makefile.am @@ -347,6 +347,7 @@ dist_zshcompletion_DATA = \ shell-completion/zsh/_systemctl \ shell-completion/zsh/_journalctl \ shell-completion/zsh/_udevadm \ + shell-completion/zsh/_kernel-install \ shell-completion/zsh/_systemd-nspawn \ shell-completion/zsh/_systemd-analyze \ shell-completion/zsh/_systemd diff --git a/shell-completion/zsh/_kernel-install b/shell-completion/zsh/_kernel-install new file mode 100644 index 000..0655188 --- /dev/null +++ b/shell-completion/zsh/_kernel-install @@ -0,0 +1,26 @@ +#compdef kernel-install + +_images(){ +if [[ $words[2] == remove ]]; then +_message 'No more options' +else +_path_files -W /boot/ -P /boot/ -g vmlinuz-* +fi +} + +_kernels(){ +read _MACHINE_ID /etc/machine-id +_kernel=( /lib/modules/[0-9]* ) +if [[ $cmd == remove -n $_MACHINE_ID ]]; then +_kernel=( /lib/modules/[0-9]* /boot/$_MACHINE_ID/[0-9]* ) +fi +_kernel=( ${_kernel##*/} ) +_describe installed kernels _kernel +} + +_arguments \ +'1::add or remove:(add remove)' \ +'2::kernel versions:_kernels' \ +'3::kernel images:_images' + +#vim: set ft=zsh sw=4 ts=4 et -- 1.8.3.4 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] macros in systemd unit files question
On Thu, Aug 1, 2013 at 9:41 AM, Colin Guthrie gm...@colin.guthr.ie wrote: 'Twas brillig, and lux-integ at 01/08/13 15:25 did gyre and gimble: On Thursday 01 August 2013 12:58:46 Tom Gundersen wrote: 'm not following. Do you mean that systemd is already doing what you need, not sure as I am just learning ...but suppose I have already mounted proc, run and sys and I want just a read only root filesystem --a) how do I get systemd to mount a nonRW root filesystemand not bother with anything in fstab.? OR --b) could I have an fstab with / -o,ro? ( and if so what would systemd-remount-fs.service do ?) Exactly the same as with sysvinit - just set the options in fstab. Or if you don't want an fstab then set the options in the -.mount unit instead. The systemd-remount-fs.service will then basically be a no-op if the options don't change. Couldn't you just systemctl mask systemd-remount-fs.service and just keep ro in the kernel line of your bootloader? Then you just wouldn't remount the filesystem as rw, which would be what is listed in your fstab. Col -- Colin Guthrie gmane(at)colin.guthr.ie http://colin.guthr.ie/ Day Job: Tribalogic Limited http://www.tribalogic.net/ Open Source: Mageia Contributor http://www.mageia.org/ PulseAudio Hacker http://www.pulseaudio.org/ Trac Hacker http://trac.edgewall.org/ ___ 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] shell-completion: fix zsh completion installation
On Sat, Jul 27, 2013 at 5:30 PM, Garry T. Williams gtwilli...@gmail.comwrote: On 7-26-13 00:41:11 Michael Biebl wrote: 2013/7/25 William Giokas 1007...@gmail.com: Moved zsh shell completion to shell-completion/zsh/_systemd for automake's sake. Also allow users to specify where the files should go with:: ./configure --with-zshcompletiondir=/path/to/some/where and by default going to `$datadir/zsh/site-functions` I was told [1], the directory for 3rd party packages would be /usr/share/zsh/vendor-completions. But I'm not a zsh user, so I'm just paroting what I read there. If it's any help, I am a zsh user and Fedora 19 has this file installed on my system: /usr/share/zsh/5.0.2/functions/_systemd My /usr/share/zsh/site-functions directory is empty. -- Garry T. Williams ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel That version is the old systemd completion that is still in the last zsh release, from before I moved it to the systemd repository and added a most of the other commands and options -- Daniel Wallace ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCHv2] Allow for the use of @ in remote host calls
Without this you have to use %40 with the -H flag because dbus doesn't like the @ sign being unescaped. --- src/hostname/hostnamectl.c | 5 +++-- src/locale/localectl.c | 5 +++-- src/login/loginctl.c | 5 +++-- src/shared/dbus-common.c | 4 ++-- src/shared/util.c | 10 ++ src/shared/util.h | 1 + src/systemctl/systemctl.c | 7 --- src/timedate/timedatectl.c | 5 +++-- 8 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c index d108a24..f7d844b 100644 --- a/src/hostname/hostnamectl.c +++ b/src/hostname/hostnamectl.c @@ -44,7 +44,8 @@ static enum transport { TRANSPORT_POLKIT } arg_transport = TRANSPORT_NORMAL; static bool arg_ask_password = true; -static const char *arg_host = NULL; +static char *arg_host = NULL; +static char *arg_user = NULL; static bool arg_set_transient = false; static bool arg_set_pretty = false; static bool arg_set_static = false; @@ -421,7 +422,7 @@ static int parse_argv(int argc, char *argv[]) { case 'H': arg_transport = TRANSPORT_SSH; -arg_host = optarg; +parse_user_at_host(optarg, arg_user, arg_host); break; case ARG_SET_TRANSIENT: diff --git a/src/locale/localectl.c b/src/locale/localectl.c index b5cd344..cd7356a 100644 --- a/src/locale/localectl.c +++ b/src/locale/localectl.c @@ -46,7 +46,8 @@ static enum transport { TRANSPORT_POLKIT } arg_transport = TRANSPORT_NORMAL; static bool arg_ask_password = true; -static const char *arg_host = NULL; +static char *arg_host = NULL; +static char *arg_user = NULL; static bool arg_convert = true; static void pager_open_if_enabled(void) { @@ -777,7 +778,7 @@ static int parse_argv(int argc, char *argv[]) { case 'H': arg_transport = TRANSPORT_SSH; -arg_host = optarg; +parse_user_at_host(optarg, arg_user, arg_host); break; case ARG_NO_CONVERT: diff --git a/src/login/loginctl.c b/src/login/loginctl.c index caaea8d..b09aa37 100644 --- a/src/login/loginctl.c +++ b/src/login/loginctl.c @@ -50,7 +50,8 @@ static enum transport { TRANSPORT_POLKIT } arg_transport = TRANSPORT_NORMAL; static bool arg_ask_password = true; -static const char *arg_host = NULL; +static char *arg_host = NULL; +static char *arg_user = NULL; static void pager_open_if_enabled(void) { @@ -1421,7 +1422,7 @@ static int parse_argv(int argc, char *argv[]) { case 'H': arg_transport = TRANSPORT_SSH; -arg_host = optarg; +parse_user_at_host(optarg, arg_user, arg_host); break; case ARG_FULL: diff --git a/src/shared/dbus-common.c b/src/shared/dbus-common.c index b8c15cb..f579567 100644 --- a/src/shared/dbus-common.c +++ b/src/shared/dbus-common.c @@ -178,9 +178,9 @@ int bus_connect_system_ssh(const char *user, const char *host, DBusConnection ** assert(user || host); if (user host) -asprintf(p, unixexec:path=ssh,argv1=-xT,argv2=%s@%s,argv3=systemd-stdio-bridge, user, host); +asprintf(p, unixexec:path=ssh,argv1=-xT,argv2=%s%%40%s,argv3=systemd-stdio-bridge, user, host); else if (user) -asprintf(p, unixexec:path=ssh,argv1=-xT,argv2=%s@localhost,argv3=systemd-stdio-bridge, user); +asprintf(p, unixexec:path=ssh,argv1=-xT,argv2=%s%%40localhost,argv3=systemd-stdio-bridge, user); else if (host) asprintf(p, unixexec:path=ssh,argv1=-xT,argv2=%s,argv3=systemd-stdio-bridge, host); diff --git a/src/shared/util.c b/src/shared/util.c index 2edf9cd..6cdd762 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -5847,3 +5847,13 @@ bool id128_is_valid(const char *s) { return true; } + +void parse_user_at_host(char *arg, char **user, char **host) { +*host = strchr(arg, '@'); +if (*host == NULL) +*host = arg; +else { +*host[0]++ = '\0'; +*user = arg; +} +} diff --git a/src/shared/util.h b/src/shared/util.h index 64e63b8..e6f9312 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -732,3 +732,4 @@ static inline void _reset_locale_(struct _locale_struct_ *s) { _saved_locale_.quit = true) bool id128_is_valid(const char *s) _pure_; +void parse_user_at_host(char *arg, char **user, char **host); diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 58a6fd4..a20290e 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -129,7 +129,8 @@ static enum transport { TRANSPORT_SSH, TRANSPORT_POLKIT } arg_transport = TRANSPORT_NORMAL; -static const char
[systemd-devel] [PATCH] Allow for the use of @ in remote host calls
Without this you have to use %40 with the -H flag because dbus doesn't like the @ sign being unescaped. --- src/hostname/hostnamectl.c | 12 ++-- src/locale/localectl.c | 12 ++-- src/login/loginctl.c | 12 ++-- src/shared/dbus-common.c | 4 ++-- src/systemctl/systemctl.c | 14 +++--- src/timedate/timedatectl.c | 12 ++-- 6 files changed, 53 insertions(+), 13 deletions(-) diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c index d108a24..178f9bc 100644 --- a/src/hostname/hostnamectl.c +++ b/src/hostname/hostnamectl.c @@ -44,7 +44,8 @@ static enum transport { TRANSPORT_POLKIT } arg_transport = TRANSPORT_NORMAL; static bool arg_ask_password = true; -static const char *arg_host = NULL; +static char *arg_host = NULL; +static char *arg_user = NULL; static bool arg_set_transient = false; static bool arg_set_pretty = false; static bool arg_set_static = false; @@ -421,7 +422,14 @@ static int parse_argv(int argc, char *argv[]) { case 'H': arg_transport = TRANSPORT_SSH; -arg_host = optarg; +arg_host = strchr(optarg, '@'); +if (arg_host == NULL) +arg_host = optarg; +else { +arg_host[0] = '\0'; +arg_host++; +arg_user = optarg; +} break; case ARG_SET_TRANSIENT: diff --git a/src/locale/localectl.c b/src/locale/localectl.c index b5cd344..30a6724 100644 --- a/src/locale/localectl.c +++ b/src/locale/localectl.c @@ -46,7 +46,8 @@ static enum transport { TRANSPORT_POLKIT } arg_transport = TRANSPORT_NORMAL; static bool arg_ask_password = true; -static const char *arg_host = NULL; +static char *arg_host = NULL; +static char *arg_user = NULL; static bool arg_convert = true; static void pager_open_if_enabled(void) { @@ -777,7 +778,14 @@ static int parse_argv(int argc, char *argv[]) { case 'H': arg_transport = TRANSPORT_SSH; -arg_host = optarg; +arg_host = strchr(optarg, '@'); +if (arg_host == NULL) +arg_host = optarg; +else { +arg_host[0] = '\0'; +arg_host++; +arg_user = optarg; +} break; case ARG_NO_CONVERT: diff --git a/src/login/loginctl.c b/src/login/loginctl.c index caaea8d..ed24377 100644 --- a/src/login/loginctl.c +++ b/src/login/loginctl.c @@ -50,7 +50,8 @@ static enum transport { TRANSPORT_POLKIT } arg_transport = TRANSPORT_NORMAL; static bool arg_ask_password = true; -static const char *arg_host = NULL; +static char *arg_host = NULL; +static char *arg_user = NULL; static void pager_open_if_enabled(void) { @@ -1421,7 +1422,14 @@ static int parse_argv(int argc, char *argv[]) { case 'H': arg_transport = TRANSPORT_SSH; -arg_host = optarg; +arg_host = strchr(optarg, '@'); +if (arg_host == NULL) +arg_host = optarg; +else { +arg_host[0] = '\0'; +arg_host++; +arg_user = optarg; +} break; case ARG_FULL: diff --git a/src/shared/dbus-common.c b/src/shared/dbus-common.c index b8c15cb..f579567 100644 --- a/src/shared/dbus-common.c +++ b/src/shared/dbus-common.c @@ -178,9 +178,9 @@ int bus_connect_system_ssh(const char *user, const char *host, DBusConnection ** assert(user || host); if (user host) -asprintf(p, unixexec:path=ssh,argv1=-xT,argv2=%s@%s,argv3=systemd-stdio-bridge, user, host); +asprintf(p, unixexec:path=ssh,argv1=-xT,argv2=%s%%40%s,argv3=systemd-stdio-bridge, user, host); else if (user) -asprintf(p, unixexec:path=ssh,argv1=-xT,argv2=%s@localhost,argv3=systemd-stdio-bridge, user); +asprintf(p, unixexec:path=ssh,argv1=-xT,argv2=%s%%40localhost,argv3=systemd-stdio-bridge, user); else if (host) asprintf(p, unixexec:path=ssh,argv1=-xT,argv2=%s,argv3=systemd-stdio-bridge, host); diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 58a6fd4..cc6db5d 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -129,7 +129,8 @@ static enum transport { TRANSPORT_SSH, TRANSPORT_POLKIT } arg_transport = TRANSPORT_NORMAL; -static const char
[systemd-devel] [PATCH] zsh_completion: complete only pids for systemd-coredumpctl
Instead of completing the whole line, which doesn't work, only complete the pid, but still show the whole line so the user can see which command was which. Users can also let the parameter expansion sort the completion by date instead of by pid, by setting zstyle ':completion:*:*:systemd-coredumpctl:*' sort no so that the zshcompsys doesn't sort the _describe function for only systemd-coredumpctl. --- shell-completion/systemd-zsh-completion.zsh | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/shell-completion/systemd-zsh-completion.zsh b/shell-completion/systemd-zsh-completion.zsh index b29a2e9..411646e 100644 --- a/shell-completion/systemd-zsh-completion.zsh +++ b/shell-completion/systemd-zsh-completion.zsh @@ -896,12 +896,13 @@ _systemd-coredumpctl_command(){ _describe -t commands 'systemd-coredumpctl command' _systemd_coredumpctl_cmds else local curcontext=$curcontext -local -a dumps +local -a _dumps cmd=${${_systemd_coredumpctl_cmds[(r)$words[1]:*]%%:*}} if (( $#cmd )); then -dumps=( ${(f)$(_call_program dumps systemd-coredumpctl list 2/dev/null)} ) -if [[ -n $dumps ]]; then -compadd ${dumps[@]} + # user can set zstyle ':completion:*:*:systemd-coredumpctl:*' sort no for coredumps to be ordered by date, otherwise they get ordered by pid + _dumps=( ${(foa)$(systemd-coredumpctl list | awk 'BEGIN{OFS=:} /^\s/ {sub(/[[ \t]+/, ); print $5,$0}' 2/dev/null)} ) +if [[ -n $_dumps ]]; then +_describe -t pids 'coredumps' _dumps else _message no coredumps fi -- 1.8.2.2 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] zsh_completion: fix udevadm monitor flags
The brackets in the _arguments description of udevadm monitor need to be escaped. --- shell-completion/systemd-zsh-completion.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell-completion/systemd-zsh-completion.zsh b/shell-completion/systemd-zsh-completion.zsh index 73db378..5cbddfe 100644 --- a/shell-completion/systemd-zsh-completion.zsh +++ b/shell-completion/systemd-zsh-completion.zsh @@ -969,7 +969,7 @@ _udevadm_monitor(){ '--kernel[Print the kernel uevents.]' \ '--udev[Print the udev event after the rule processing.]' \ '--property[Also print the properties of the event.]' \ -'--subsystem-match=[Filter events by subsystem[/devtype].]' \ +'--subsystem-match=[Filter events by subsystem/\[devtype\].]' \ '--tag-match=[Filter events by property.]' \ '--help[Print help text.]' } -- 1.8.2.2 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] zsh-completion: journalctl query by binary and device
implement 1883552c3d8 from bash completion in zsh-completion --- shell-completion/systemd-zsh-completion.zsh | 11 +++ 1 file changed, 11 insertions(+) diff --git a/shell-completion/systemd-zsh-completion.zsh b/shell-completion/systemd-zsh-completion.zsh index 46e29b2..77b26f6 100644 --- a/shell-completion/systemd-zsh-completion.zsh +++ b/shell-completion/systemd-zsh-completion.zsh @@ -94,6 +94,7 @@ _ctls() '--verify[Verify journal file consistency]' \ '--list-catalog[List messages in catalog]' \ '--update-catalog[Update binary catalog database]' \ +'*::default: _journal_none' ;; localectl) _arguments \ @@ -608,6 +609,7 @@ _list_fields() { _{P,U,G}ID _COMM _EXE _CMDLINE _AUDIT_{SESSION,LOGINUID} _SYSTEMD_{CGROUP,SESSION,UNIT,OWNER_UID} +_SYSTEMD_USER_UNIT _SELINUX_CONTEXT _SOURCE_REALTIME_TIMESTAMP _{BOOT,MACHINE}_ID _HOSTNAME _TRANSPORT _KERNEL_{DEVICE,SUBSYSTEM} @@ -616,6 +618,15 @@ _list_fields() { _describe 'possible fields' journal_fields } +_journal_none() { +local -a _commands _files +_commands=( ${(f)$(_call_program commands $service -F _EXE 2/dev/null)} ) +_alternative : \ +'files:/dev files:_files -W /dev -P /dev/' \ +commands:commands:($_commands[@]) \ +'fields:fields:_list_fields' +} + _journal_fields() { local -a _fields cmd cmd=(journalctl -F ${@[-1]} 2/dev/null ) -- 1.8.1.5 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] query for user unit information in the journal
Add --user-unit= to make it possible to query for user logs by the name of the service. --- man/journalctl.xml | 11 +++ shell-completion/systemd-bash-completion.sh | 5 - shell-completion/systemd-zsh-completion.zsh | 1 + src/journal/journalctl.c| 13 - 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/man/journalctl.xml b/man/journalctl.xml index 5ed0e1f..09a96ac 100644 --- a/man/journalctl.xml +++ b/man/journalctl.xml @@ -306,6 +306,17 @@ /varlistentry varlistentry +termoption--user-unit=/option/term + +listitemparaShow data only of the +specified user session unit. This will +add a match for +literal_SYSTEMD_USER_UNIT=/literal +for the specified +unit./para/listitem +/varlistentry + +varlistentry termoption-p/option/term termoption--priority=/option/term diff --git a/shell-completion/systemd-bash-completion.sh b/shell-completion/systemd-bash-completion.sh index 1132b3c..117dc55 100644 --- a/shell-completion/systemd-bash-completion.sh +++ b/shell-completion/systemd-bash-completion.sh @@ -300,7 +300,7 @@ _journalctl() { -h --help -l --local --new-id128 -m --merge --no-pager --no-tail -q --quiet --setup-keys --this-boot --verify --version --list-catalog --update-catalog' - [ARG]='-D --directory -F --field -o --output -u --unit' + [ARG]='-D --directory -F --field -o --output -u --unit --user-unit' [ARGUNKNOWN]='-c --cursor --interval -n --lines -p --priority --since --until --verify-key' ) @@ -320,6 +320,9 @@ _journalctl() { --unit|-u) comps=$(journalctl -F '_SYSTEMD_UNIT') ;; +--user-unit) +comps=$(journalctl -F '_SYSTEMD_USER_UNIT') +;; *) return 0 ;; diff --git a/shell-completion/systemd-zsh-completion.zsh b/shell-completion/systemd-zsh-completion.zsh index 177a564..46e29b2 100644 --- a/shell-completion/systemd-zsh-completion.zsh +++ b/shell-completion/systemd-zsh-completion.zsh @@ -70,6 +70,7 @@ _ctls() {-c,--cursor=}'[Start showing entries from specified cursor]:cursors:_journal_fields __CURSORS' \ {-b,--this-boot}'[Show data only from current boot]' \ {-u,--unit=}'[Show data only from the specified unit]:units:_journal_fields _SYSTEMD_UNIT' \ +'--user-unit[Show data only from the specified user session unit]:units:_journal_fields _SYSTEMD_USER_UNIT' \ {-p,--priority=}'[Show only messages within the specified priority range]:priority:_journal_fields PRIORITY' \ {-f,--follow}'[Follow journal]' \ {-n,--lines=}'[Number of journal entries to show]:integer' \ diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 0afeef9..bfea699 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -75,6 +75,7 @@ static usec_t arg_interval = DEFAULT_FSS_INTERVAL_USEC; static usec_t arg_since, arg_until; static bool arg_since_set = false, arg_until_set = false; static const char *arg_unit = NULL; +static const char *arg_unit_type = NULL; static const char *arg_field = NULL; static bool arg_catalog = false; @@ -99,6 +100,7 @@ static int help(void) { -c --cursor=CURSOR Start showing entries from specified cursor\n -b --this-boot Show data only from current boot\n -u --unit=UNIT Show data only from the specified unit\n +--user-unit=UNITShow data only from the specified user session unit\n -p --priority=RANGEShow only messages within the specified priority range\n -f --followFollow journal\n -n --lines[=INTEGER] Number of journal entries to show\n @@ -150,6 +152,7 @@ static int parse_argv(int argc, char *argv[]) { ARG_DISK_USAGE, ARG_SINCE, ARG_UNTIL, +ARG_USER_UNIT, ARG_LIST_CATALOG, ARG_UPDATE_CATALOG }; @@ -179,6 +182,7 @@ static int parse_argv(int argc, char *argv[]) { { cursor, required_argument, NULL, 'c' }, { since,
[systemd-devel] [PATCH] add %U for uids in units
--- man/systemd.unit.xml | 5 + src/core/unit-printf.c | 17 +++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml index 35644d3..bf91b4e 100644 --- a/man/systemd.unit.xml +++ b/man/systemd.unit.xml @@ -264,6 +264,11 @@ entryThis is the name of the configured user of the unit, or (if none is set) the user running the systemd instance./entry /row row +entryliteral%U/literal/entry +entryUser uid/entry +entryThis is the uid of the configured user of the unit, or (if none is set) the user running the systemd instance./entry + /row + row entryliteral%h/literal/entry entryUser home directory/entry entryThis is the home directory of the configured user of the unit, or (if none is set) the user running the systemd instance./entry diff --git a/src/core/unit-printf.c b/src/core/unit-printf.c index a8eb60a..a58c96c 100644 --- a/src/core/unit-printf.c +++ b/src/core/unit-printf.c @@ -123,6 +123,8 @@ static char *specifier_user_name(char specifier, void *data, void *userdata) { ExecContext *c; int r; const char *username; +uid_t uid; +char *printed = NULL; assert(u); @@ -134,11 +136,21 @@ static char *specifier_user_name(char specifier, void *data, void *userdata) { /* fish username from passwd */ username = c-user; -r = get_user_creds(username, NULL, NULL, NULL, NULL); +r = get_user_creds(username, uid, NULL, NULL, NULL); if (r 0) return NULL; -return strdup(username); +switch (specifier) { +case 'U': +if (asprintf(printed, %d, uid) 0) +return NULL; +break; +case 'u': +printed = strdup(username); +break; +} + +return printed; } static char *specifier_user_home(char specifier, void *data, void *userdata) { @@ -292,6 +304,7 @@ char *unit_full_printf(Unit *u, const char *format) { { 'r', specifier_cgroup_root, NULL }, { 'R', specifier_cgroup_root, NULL }, { 't', specifier_runtime, NULL }, +{ 'U', specifier_user_name, NULL }, { 'u', specifier_user_name, NULL }, { 'h', specifier_user_home, NULL }, { 's', specifier_user_shell, NULL }, -- 1.8.0.1 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] [PATCH] fix --full for journalctl zsh completion
--- shell-completion/systemd-zsh-completion.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell-completion/systemd-zsh-completion.zsh b/shell-completion/systemd-zsh-completion.zsh index 7799bf6..a58f4ae 100644 --- a/shell-completion/systemd-zsh-completion.zsh +++ b/shell-completion/systemd-zsh-completion.zsh @@ -77,7 +77,7 @@ _ctls() {-n,--lines=}'[Number of journal entries to show]:integer' \ '--no-tail[Show all lines, even in follow mode]' \ {-o,--output=}'[Change journal output mode]:output modes:_outputmodes' \ -{--full}'[Show long fields in full]' \ +'--full[Show long fields in full]' \ {-a,--all}'[Show all fields, including long and unprintable]' \ {-q,--quiet}[Don't show privilege warning] \ '--no-pager[Do not pipe output into a pager]' \ -- 1.8.0 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] [PATCH] Add zsh completion
On Fri, Oct 26, 2012 at 08:41:50AM -0400, Dave Reisner wrote: On Fri, Oct 26, 2012 at 05:58:41AM -0400, Daniel Wallace wrote: From: Daniel Wallace daniel.wall...@gatech.edu I updated the zsh completion from zsh, and added completion for all the other *ctl commands --- Makefile.am| 4 + bash-completion/systemd-zsh-completion.zsh | 718 + 2 files changed, 722 insertions(+) create mode 100644 bash-completion/systemd-zsh-completion.zsh Why duplicate the entire completion file here, and not just offer the additions to ZSH's upstream? Have you talked to the ZSH devs about this? /confused I did email the zsh-workers list, and the only response I got was Do what works and since systemd keeps changing and releases far more often than zsh does, I feel that it should just be in the upstream package, instead of in /usr/share/zsh/functions/Completion/Unix/_systemd. so I updated it and sent it here :) Thanks -- Daniel Wallace Archlinux Trusted User (gtmanfred) Georgia Institute of Technology pgpH66uihfRTk.pgp Description: PGP signature ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel