Why systemd-analyze from systemd service at multi-user.target does not output anything The 2019 Stack Overflow Developer Survey Results Are InSystemD: configure unit file so that login screen is not shown until service exits and rebootsAdding a systemd .service (Debian)systemd and OpenVPN woes after an Ubuntu upgradeMailX not sending email when run as a Systemd serviceWhy won't my enabled systemd service start on boot?Why is systemd stopping service immediately after it is started?Instruct to execute an unit after completing another unit successfullysystemd: finish the execution of custom shell script before starting nginxSystemd service works when started, but not when enabledStopping systemd unit together with another. Starting works

Multi tool use
Multi tool use

If climate change impact can be observed in nature, has that had any effect on rural, i.e. farming community, perception of the scientific consensus?

Why doesn't UInt have a toDouble()?

Match Roman Numerals

Output the Arecibo Message

If my opponent casts Ultimate Price on my Phantasmal Bear, can I save it by casting Snap or Curfew?

How to quickly solve partial fractions equation?

What do these terms in Caesar's Gallic Wars mean?

Why are there uneven bright areas in this photo of black hole?

Is an up-to-date browser secure on an out-of-date OS?

Can we generate random numbers using irrational numbers like π and e?

How can I add encounters in the Lost Mine of Phandelver campaign without giving PCs too much XP?

ELI5: Why they say that Israel would have been the fourth country to land a spacecraft on the Moon and why they call it low cost?

Are spiders unable to hurt humans, especially very small spiders?

What does Linus Torvalds mean when he says that Git "never ever" tracks a file?

Can you cast a spell on someone in the Ethereal Plane, if you are on the Material Plane and have the True Seeing spell active?

Is bread bad for ducks?

Can a flute soloist sit?

Is it okay to consider publishing in my first year of PhD?

A female thief is not sold to make restitution -- so what happens instead?

Mathematics of imaging the black hole

Why isn't the circumferential light around the M87 black hole's event horizon symmetric?

Can there be female White Walkers?

What is the meaning of Triage in Cybersec world?

Is there a way to generate a uniformly distributed point on a sphere from a fixed amount of random real numbers?



Why systemd-analyze from systemd service at multi-user.target does not output anything



The 2019 Stack Overflow Developer Survey Results Are InSystemD: configure unit file so that login screen is not shown until service exits and rebootsAdding a systemd .service (Debian)systemd and OpenVPN woes after an Ubuntu upgradeMailX not sending email when run as a Systemd serviceWhy won't my enabled systemd service start on boot?Why is systemd stopping service immediately after it is started?Instruct to execute an unit after completing another unit successfullysystemd: finish the execution of custom shell script before starting nginxSystemd service works when started, but not when enabledStopping systemd unit together with another. Starting works



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















Having the following script:
boot-time-log.sh



#!/usr/bin/env bash

BOOT_TIME=$(systemd-analyze | cut --fields=10 --delimiter= )
echo -e "Boot time: $BOOT_TIMEn" > /var/log/boot_time.txt


And the following systemd service (enabled):
log_at_boot.service



[Unit]
Description=Log boot time
User=root
Group=root

[Service]
ExecStart=/usr/bin/boot-time-log.sh

[Install]
Wants=network-online.target
After=network-online.target
Wants=multi-user.target
After=multi-user.target


When I restart the PC the contents of /var/log/boot_time.txt are:



Boot time: 


And if I run the script manually, then the contents are:



Boot time: 29.382s


How can I get the service execution to have the same output than the manual execution?










share|improve this question







New contributor




Roma Bejar Vila is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • I used a systemd timer for 15 seconds from "OnStartupSec", and works (There is proper output). If I use less seconds of delay, the output of systemd-analyze is empty. Does somebody know why the output of systemd-analyze is empty if executed too early? And if there is a cleaner way to get this result?

    – Roma Bejar Vila
    2 days ago












  • I started down the path of while ! systemctl is-active "$(systemctl get-default)" but didn't get to the bottom of it, in case anyone wants to extend it from there.

    – Jeff Schaller
    2 days ago

















0















Having the following script:
boot-time-log.sh



#!/usr/bin/env bash

BOOT_TIME=$(systemd-analyze | cut --fields=10 --delimiter= )
echo -e "Boot time: $BOOT_TIMEn" > /var/log/boot_time.txt


And the following systemd service (enabled):
log_at_boot.service



[Unit]
Description=Log boot time
User=root
Group=root

[Service]
ExecStart=/usr/bin/boot-time-log.sh

[Install]
Wants=network-online.target
After=network-online.target
Wants=multi-user.target
After=multi-user.target


When I restart the PC the contents of /var/log/boot_time.txt are:



Boot time: 


And if I run the script manually, then the contents are:



Boot time: 29.382s


How can I get the service execution to have the same output than the manual execution?










share|improve this question







New contributor




Roma Bejar Vila is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • I used a systemd timer for 15 seconds from "OnStartupSec", and works (There is proper output). If I use less seconds of delay, the output of systemd-analyze is empty. Does somebody know why the output of systemd-analyze is empty if executed too early? And if there is a cleaner way to get this result?

    – Roma Bejar Vila
    2 days ago












  • I started down the path of while ! systemctl is-active "$(systemctl get-default)" but didn't get to the bottom of it, in case anyone wants to extend it from there.

    – Jeff Schaller
    2 days ago













0












0








0








Having the following script:
boot-time-log.sh



#!/usr/bin/env bash

BOOT_TIME=$(systemd-analyze | cut --fields=10 --delimiter= )
echo -e "Boot time: $BOOT_TIMEn" > /var/log/boot_time.txt


And the following systemd service (enabled):
log_at_boot.service



[Unit]
Description=Log boot time
User=root
Group=root

[Service]
ExecStart=/usr/bin/boot-time-log.sh

[Install]
Wants=network-online.target
After=network-online.target
Wants=multi-user.target
After=multi-user.target


When I restart the PC the contents of /var/log/boot_time.txt are:



Boot time: 


And if I run the script manually, then the contents are:



Boot time: 29.382s


How can I get the service execution to have the same output than the manual execution?










share|improve this question







New contributor




Roma Bejar Vila is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












Having the following script:
boot-time-log.sh



#!/usr/bin/env bash

BOOT_TIME=$(systemd-analyze | cut --fields=10 --delimiter= )
echo -e "Boot time: $BOOT_TIMEn" > /var/log/boot_time.txt


And the following systemd service (enabled):
log_at_boot.service



[Unit]
Description=Log boot time
User=root
Group=root

[Service]
ExecStart=/usr/bin/boot-time-log.sh

[Install]
Wants=network-online.target
After=network-online.target
Wants=multi-user.target
After=multi-user.target


When I restart the PC the contents of /var/log/boot_time.txt are:



Boot time: 


And if I run the script manually, then the contents are:



Boot time: 29.382s


How can I get the service execution to have the same output than the manual execution?







shell-script systemd






share|improve this question







New contributor




Roma Bejar Vila is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




Roma Bejar Vila is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




Roma Bejar Vila is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Apr 8 at 12:48









Roma Bejar VilaRoma Bejar Vila

1




1




New contributor




Roma Bejar Vila is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Roma Bejar Vila is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Roma Bejar Vila is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • I used a systemd timer for 15 seconds from "OnStartupSec", and works (There is proper output). If I use less seconds of delay, the output of systemd-analyze is empty. Does somebody know why the output of systemd-analyze is empty if executed too early? And if there is a cleaner way to get this result?

    – Roma Bejar Vila
    2 days ago












  • I started down the path of while ! systemctl is-active "$(systemctl get-default)" but didn't get to the bottom of it, in case anyone wants to extend it from there.

    – Jeff Schaller
    2 days ago

















  • I used a systemd timer for 15 seconds from "OnStartupSec", and works (There is proper output). If I use less seconds of delay, the output of systemd-analyze is empty. Does somebody know why the output of systemd-analyze is empty if executed too early? And if there is a cleaner way to get this result?

    – Roma Bejar Vila
    2 days ago












  • I started down the path of while ! systemctl is-active "$(systemctl get-default)" but didn't get to the bottom of it, in case anyone wants to extend it from there.

    – Jeff Schaller
    2 days ago
















I used a systemd timer for 15 seconds from "OnStartupSec", and works (There is proper output). If I use less seconds of delay, the output of systemd-analyze is empty. Does somebody know why the output of systemd-analyze is empty if executed too early? And if there is a cleaner way to get this result?

– Roma Bejar Vila
2 days ago






I used a systemd timer for 15 seconds from "OnStartupSec", and works (There is proper output). If I use less seconds of delay, the output of systemd-analyze is empty. Does somebody know why the output of systemd-analyze is empty if executed too early? And if there is a cleaner way to get this result?

– Roma Bejar Vila
2 days ago














I started down the path of while ! systemctl is-active "$(systemctl get-default)" but didn't get to the bottom of it, in case anyone wants to extend it from there.

– Jeff Schaller
2 days ago





I started down the path of while ! systemctl is-active "$(systemctl get-default)" but didn't get to the bottom of it, in case anyone wants to extend it from there.

– Jeff Schaller
2 days ago










0






active

oldest

votes












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);






Roma Bejar Vila is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511227%2fwhy-systemd-analyze-from-systemd-service-at-multi-user-target-does-not-output-an%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes








Roma Bejar Vila is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















Roma Bejar Vila is a new contributor. Be nice, and check out our Code of Conduct.












Roma Bejar Vila is a new contributor. Be nice, and check out our Code of Conduct.











Roma Bejar Vila is a new contributor. Be nice, and check out our Code of Conduct.














Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511227%2fwhy-systemd-analyze-from-systemd-service-at-multi-user-target-does-not-output-an%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







zCBr Z nKPV8gJ9eiOHX SWH2kkwHIZ95ayQ,J 51fQlsPNVO KwBXTj7hwpKK3BbrDi5 1 sxu,cKNG2Eee6QR 3aTavKC6hv
rKDi,rMT1ZzStkzSGznSlasPyUXsCp470j,U,5fFT1Re

Popular posts from this blog

getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

NetworkManager fails with “Could not find source connection”Trouble connecting to VPN using network-manager, while command line worksHow can I be notified about state changes to a VPN adapterBacktrack 5 R3 - Refuses to connect to VPNFeed all traffic through OpenVPN for a specific network namespace onlyRun daemon on startup in Debian once openvpn connection establishedpfsense tcp connection between openvpn and lan is brokenInternet connection problem with web browsers onlyWhy does NetworkManager explicitly support tun/tap devices?Browser issues with VPNTwo IP addresses assigned to the same network card - OpenVPN issues?Cannot connect to WiFi with nmcli, although secrets are provided

Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.