Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: How do I restart all processes using systemd?

  1. #11

    Default Re: How do I restart all processes using systemd?

    Quote Originally Posted by eng-int View Post
    Is there a specific reason that you cannot simply reboot, or is this a file parsing exercise for amusement?
    Some services should be restarted by the user-owner, and others by root. If display-manager is restarted you will be logged out of KDE anyway. The kernel can only be changed by rebooting.

    You should be thinking of commands like sed, awk, and tr. For instance this might restart all the enabled service units -- and no I haven't tried it. and it's pretty pointless in the real world:
    Code:
    # systemctl reboot `systemctl list-unit-files --type=service --state=enabled --all |sed -n '/enabled/s/ .*$/ /p' |tr -d '\n'`
    # systemctl reboot `systemctl list-unit-files --type=service --state=enabled --all |sed -n '/enabled/s/ .*$/ /p' |tr -d '\n'`
    Too many arguments.

    Close... Ty.

  2. #12
    Join Date
    Oct 2008
    Location
    Glasgow, Scotland
    Posts
    1,151

    Default Re: How do I restart all processes using systemd?

    Quote Originally Posted by ryanbach View Post
    # systemctl reboot `systemctl list-unit-files --type=service --state=enabled --all |sed -n '/enabled/s/ .*$/ /p' |tr -d '\n'`
    Too many arguments.
    Sorry, my bad. I meant “systemctl restart”, but it still might be too long. Please explain why you are doing this and not just “systemctl reboot” or somesuch -- as I said it seems pointless.
    Code:
     # systemctl restart  `systemctl list-unit-files --type=service --state=enabled --all |sed -n '/enabled/ s/.service.*$/ /p' | tr -d '\n'`
    ~Thank you for sharing an interesting problem.
    --
    slàinte mhath,
    rayH

  3. #13

    Default Re: How do I restart all processes using systemd?

    Quote Originally Posted by eng-int View Post
    Sorry, my bad. I meant “systemctl restart”, but it still might be too long. Please explain why you are doing this and not just “systemctl reboot” or somesuch -- as I said it seems pointless.
    Code:
     # systemctl restart  `systemctl list-unit-files --type=service --state=enabled --all |sed -n '/enabled/ s/.service.*$/ /p' | tr -d '\n'`
    I am trying to update my system because when I reboot it doesn't seem to save. I may have to do this in the future when yast2 installer is fixed for my usb thumbdrive.

  4. #14

    Default Re: How do I restart all processes using systemd?

    Hi,

    Just an alternative using awk.

    Code:
    systemctl list-unit-files --type=service --state=enabled --all | awk '$NF == "enabled" {sub(/\.service/,"",$1); printf "%s ", $1}'
    "Unfortunately time is always against us" -- [Morpheus]

    .:https://github.com/Jetchisel:.

  5. #15
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,475
    Blog Entries
    2

    Default Re: How do I restart all processes using systemd?

    Would want to know why you would want to restart all services (a bit unusual).

    If instead, you just want all services to pick up configuration changes you made without rebooting, then the following command will do that for you
    Code:
    systemctl daemon-reload
    IMO the above is simple and works.
    But, if you for some reason want only a specific service to pick up the changes and don't interrupt all services, then you can append the service name to the end of the command.

    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!

  6. #16

    Default Re: How do I restart all processes using systemd?

    Quote Originally Posted by jetchisel View Post
    Hi,

    Just an alternative using awk.

    Code:
    systemctl list-unit-files --type=service --state=enabled --all | awk '$NF == "enabled" {sub(/\.service/,"",$1); printf "%s ", $1}'
    Thanks, that lists all the files.

  7. #17

    Default Re: How do I restart all processes using systemd?

    Quote Originally Posted by tsu2 View Post
    Would want to know why you would want to restart all services (a bit unusual).

    If instead, you just want all services to pick up configuration changes you made without rebooting, then the following command will do that for you
    Code:
    systemctl daemon-reload
    IMO the above is simple and works.
    But, if you for some reason want only a specific service to pick up the changes and don't interrupt all services, then you can append the service name to the end of the command.

    TSU
    Sorry, I guess I don't need to, I thought it might fix a bug. It won't but I appreciate the help.

  8. #18
    Join Date
    Oct 2008
    Location
    Glasgow, Scotland
    Posts
    1,151

    Default Re: How do I restart all processes using systemd?

    Quote Originally Posted by ryanbach View Post
    I am trying to update my system because when I reboot it doesn't seem to save. I may have to do this in the future when yast2 installer is fixed for my usb thumbdrive.
    I am afraid that I still do not understand what is happening.

    It seems that you downloaded a Tumbleweed-KDE-Live-Snapshot iso image, installing it on a USB flash drive. You then booted a machine usinf this USB drive.

    Did you then use this TW-KDE-Live instance to install Tubleweed on a second USB device or fixed disk drive? Or are you trying to upgrade the read-only snapshot that you downloaded?
    ~Thank you for sharing an interesting problem.
    --
    slàinte mhath,
    rayH

  9. #19

    Default Re: How do I restart all processes using systemd?

    Quote Originally Posted by eng-int View Post
    I am afraid that I still do not understand what is happening.

    It seems that you downloaded a Tumbleweed-KDE-Live-Snapshot iso image, installing it on a USB flash drive. You then booted a machine usinf this USB drive.

    Did you then use this TW-KDE-Live instance to install Tubleweed on a second USB device or fixed disk drive? Or are you trying to upgrade the read-only snapshot that you downloaded?
    I didn't know it was read only.

Page 2 of 2 FirstFirst 12

Tags for this Thread

Posting Permissions

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