Results 1 to 10 of 10

Thread: Systemd-nspawn --version exits with 1

  1. #1

    Default Systemd-nspawn --version exits with 1

    Greetings,

    Not sure if this is a bug or just a functionality misunderstanding on my part. I am rather new to linux and was playing around with rkt containers when I stumbled upon this.

    When running the following 2 commands
    > systemd-nspawn --version
    > echo $?

    I get a return code of 1.
    Shouldn't this be a return code of 0?


    System Info
    VERSION_ID="20170324"
    PRETTY_NAME="openSUSE Tumbleweed"

    OpenSuse is running as a VM inside VMWare workstation. Host is Windows 10.

    Thanks!




  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,158

    Default Re: Systemd-nspawn --version exits with 1

    Hello and welcome here.

    First a technical feature of the forums here:
    Please use CODE tags around copied/pasted computer text in a post. It is the # button in the tool bar of the post editor. When applicable copy/paste complete, that is including the prompt, the command, the output and the next prompt.

    When I would then post what you did, it will look like this:
    Code:
    boven:~ # systemd-nspawn --version
    systemd 210
    +PAM +LIBWRAP +AUDIT +SELINUX -IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ +SECCOMP +APPARMOR
    boven:~ # echo $?
    0
    boven:~ #
    There is no need now to explain "when I did x, I get y", because we can see it.

    The big surprise is of course that doing this to show you an example, I get return code 0 .
    I must add that this is on openSUSE 13.2.

    The man page (on 13.2) says:
    EXIT STATUS

    The exit code of the program executed in the container is returned.
    As in the --version case there is no program executed, it is a bit doubtful what it should be. 0 looks then logical enough to me.

    I will start a LEAP 42.2 system to see what I get.

    Which I just did. And guess what? I do get a ) also there.

    Thus either you are doing something different (that is why we love you showing all from top to toe), or there is something else going on in your system.
    Last edited by hcvv; 28-Mar-2017 at 12:26.
    Henk van Velden

  3. #3
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    15,748

    Default Re: Systemd-nspawn --version exits with 1

    You do need to be root to run most systemd commands

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,158

    Default Re: Systemd-nspawn --version exits with 1

    Quote Originally Posted by gogalthorp View Post
    You do need to be root to run most systemd commands
    Well, not realy:
    Code:
    henk@boven:~> systemd-nspawn --version
    systemd 210
    +PAM +LIBWRAP +AUDIT +SELINUX -IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ +SECCOMP +APPARMOR
    henk@boven:~> echo $?
    0
    henk@boven:~>
    Asking for complete posting of prompt, command, output and prompt is of course one way to check what is done also in this aspect.

    But I agree with you that for doing anything substantial with systemd on the system level, processes must be owned by root.
    Henk van Velden

  5. #5

    Default Re: Systemd-nspawn --version exits with 1

    Ah code blocks! Thanks for the nudge.

    I've run the commands again once without sudo and once with, same output.
    Maybe there is something strange about my system setup. I'll try and create a fresh OpenSUSE Tumbleweed VM over the weekend and see if I get the same result. The current VM was "relativly" fresh but hey maybe I did something "interesting" in my noobish ignorance.

    Code:
    linux-d2c4:~> systemd-nspawn --version
    systemd 232
    +PAM -AUDIT +SELINUX -IMA +APPARMOR -SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID -ELFUTILS +KMOD -IDN
    alex@linux-d2c4:~> echo $?
    1
    alex@linux-d2c4:~> echo $?
    0
    alex@linux-d2c4:~> sudo systemd-nspawn --version
    [sudo] password for root: 
    systemd 232
    +PAM -AUDIT +SELINUX -IMA +APPARMOR -SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID -ELFUTILS +KMOD -IDN
    alex@linux-d2c4:~> echo $?
    1
    alex@linux-d2c4:~> echo $?
    0

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,158

    Default Re: Systemd-nspawn --version exits with 1

    I do not really understand why you get the return code 1. Strange.

    Butt doing the
    Code:
    echo $?
    twice is not very useful. The second echo will show the return code of the first echo, not any more of the systemd-nspawn.
    Henk van Velden

  7. #7

    Default Re: Systemd-nspawn --version exits with 1

    Hi Guys,

    I created an account to confirm this bug.

    Code:
    mitch@mitch:~> sudo /usr/bin/systemd-nspawn --version
    systemd 232
    +PAM -AUDIT +SELINUX -IMA +APPARMOR -SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID -ELFUTILS +KMOD -IDN
    mitch@mitch:~> echo $?
    1
    I am on the latest tumbleweed also playing around with rkt containers.

    I have found github threads referencing the problem:



    Appears as though it is a problem introduced by systemd, however a patch has been applied to the systemd master branch. Now to check if the patch has made it into tumbleweed systemd?

    I'm not sure of a convienient way to check if the patch is applied to the builds in the TW repos.

    Any ideas?

    Mitch

  8. #8

    Default Re: Systemd-nspawn --version exits with 1

    Well my system isn't on the latest systemd.

    Code:
    Information for package systemd:
    --------------------------------
    Repository     : repo-oss                    
    Name           : systemd                     
    Version        : 232-10.1                    
    Arch           : x86_64                      
    Vendor         : openSUSE                    
    Installed Size : 9.4 MiB                     
    Installed      : Yes                         
    Status         : up-to-date                  
    Source package : systemd-232-10.1.src        
    Summary        : A System and Session Manager
    Latest release appears to be 233.

    I have downloaded the opensuse source for systemd-232-10.2 and the error code patch has not been applied there.

    I wonder how long it will take? Not sure if I should submit bug to TW bugzilla.

    Mitch

  9. #9
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,299
    Blog Entries
    2

    Default Re: Systemd-nspawn --version exits with 1

    Quote Originally Posted by mitchy_g View Post
    Well my system isn't on the latest systemd.

    Code:
    Information for package systemd:
    --------------------------------
    Repository     : repo-oss                    
    Name           : systemd                     
    Version        : 232-10.1                    
    Arch           : x86_64                      
    Vendor         : openSUSE                    
    Installed Size : 9.4 MiB                     
    Installed      : Yes                         
    Status         : up-to-date                  
    Source package : systemd-232-10.1.src        
    Summary        : A System and Session Manager
    Latest release appears to be 233.

    I have downloaded the opensuse source for systemd-232-10.2 and the error code patch has not been applied there.

    I wonder how long it will take? Not sure if I should submit bug to TW bugzilla.

    Mitch
    You should submit a bug to bugzilla including the links to the github bug.
    The github bug claims that the bug isn't theirs, it was introduced by someone (Arch?) which is then probably being used as source by other distros.
    Only the openSUSE maintainers will know for sure what source is being used.

    It's probably not an openSUSE bug, but only the openSUSE maintainers can know who to notify to fix the bug.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  10. #10

    Default Re: Systemd-nspawn --version exits with 1

    TSU, thanks for the advice

    Bug report is here: https://bugzilla.opensuse.org/show_bug.cgi?id=1042092

    Mitch

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •