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
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;
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
New contributor
add a comment |
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
New contributor
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 ofwhile ! 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
add a comment |
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
New contributor
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
shell-script systemd
New contributor
New contributor
New contributor
asked Apr 8 at 12:48
Roma Bejar VilaRoma Bejar Vila
1
1
New contributor
New contributor
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 ofwhile ! 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
add a comment |
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 ofwhile ! 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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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.
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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