How can I prevent myself from booting a certain distro in some particular hours?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I have a dual boot setup: Manjaro KDE and Elementary OS.
Let's say I'd like to prevent Manjaro KDE from booting at a certain time (for example between 8:00 AM - 1:00 PM) so that only Elementary OS can be used in that particular time.
Since I think I can't act at GRUB level, Manjaro must certainly be able to boot but then some piece of software should prevent the user from logging in or making the distro unusable at that particular time.
Is this possible? What could I do?
linux multi-boot cron manjaro elementaryos
add a comment |
I have a dual boot setup: Manjaro KDE and Elementary OS.
Let's say I'd like to prevent Manjaro KDE from booting at a certain time (for example between 8:00 AM - 1:00 PM) so that only Elementary OS can be used in that particular time.
Since I think I can't act at GRUB level, Manjaro must certainly be able to boot but then some piece of software should prevent the user from logging in or making the distro unusable at that particular time.
Is this possible? What could I do?
linux multi-boot cron manjaro elementaryos
1
Just an hint: for example you can put a check on the time when you boot in KDE. If it is not passed you can change the boot default option (with zero waiting time) and reboot. Give it a look to this answer. Add a check oncrontab
and reboot if in the wrong time window.
– Hastur
Feb 8 at 9:40
add a comment |
I have a dual boot setup: Manjaro KDE and Elementary OS.
Let's say I'd like to prevent Manjaro KDE from booting at a certain time (for example between 8:00 AM - 1:00 PM) so that only Elementary OS can be used in that particular time.
Since I think I can't act at GRUB level, Manjaro must certainly be able to boot but then some piece of software should prevent the user from logging in or making the distro unusable at that particular time.
Is this possible? What could I do?
linux multi-boot cron manjaro elementaryos
I have a dual boot setup: Manjaro KDE and Elementary OS.
Let's say I'd like to prevent Manjaro KDE from booting at a certain time (for example between 8:00 AM - 1:00 PM) so that only Elementary OS can be used in that particular time.
Since I think I can't act at GRUB level, Manjaro must certainly be able to boot but then some piece of software should prevent the user from logging in or making the distro unusable at that particular time.
Is this possible? What could I do?
linux multi-boot cron manjaro elementaryos
linux multi-boot cron manjaro elementaryos
edited Feb 8 at 10:33
Mr Shunz
1,92512017
1,92512017
asked Feb 8 at 9:05
RaiNRaiN
132
132
1
Just an hint: for example you can put a check on the time when you boot in KDE. If it is not passed you can change the boot default option (with zero waiting time) and reboot. Give it a look to this answer. Add a check oncrontab
and reboot if in the wrong time window.
– Hastur
Feb 8 at 9:40
add a comment |
1
Just an hint: for example you can put a check on the time when you boot in KDE. If it is not passed you can change the boot default option (with zero waiting time) and reboot. Give it a look to this answer. Add a check oncrontab
and reboot if in the wrong time window.
– Hastur
Feb 8 at 9:40
1
1
Just an hint: for example you can put a check on the time when you boot in KDE. If it is not passed you can change the boot default option (with zero waiting time) and reboot. Give it a look to this answer. Add a check on
crontab
and reboot if in the wrong time window.– Hastur
Feb 8 at 9:40
Just an hint: for example you can put a check on the time when you boot in KDE. If it is not passed you can change the boot default option (with zero waiting time) and reboot. Give it a look to this answer. Add a check on
crontab
and reboot if in the wrong time window.– Hastur
Feb 8 at 9:40
add a comment |
2 Answers
2
active
oldest
votes
What it seems today it can not seem tomorrow :-)
.
You should have been allowed to use date and time related commands on /boot/grub/grub.cfg
editing /etc/grub.d
even if they should rely on the internal PC clock, that has to be protected from users under both OSes and BIOS, as well as the possibility to boot from sources different from those two. Moreover remember that a failure of the motherboard battery may lead to a corrupt time shown by the internal clock.
Give it a look on this ubuntu thread for some more practical hints or to this post for a simple panorama. Hint relays on the datehook
module and the config file (/boot/grub/grub.cfg
)
insmod datehook
if [ "$HOUR" -ge "8" -a "$HOUR" -lt "13" ]; then set default="0" #Manjaro KDE
else set default="1" #Elementary OS
fi
By hands
If you cannot use the grub
features above, you can apply a strategy
to preempt the logging in the wrong time forcing a reboot with a specific selection as described in these other answers. You should put a time check in a script that has to be executed on boot. If the check is not passed you should force a reboot with a different
grub
option.
Main steps are:
- in the
/etc/default/grub
write/checkGRUB_DEFAULT=saved
- Use
grub-set-default
(if you want) for the willed boot option
sudo update-grub
to save it
In the script to be run
grub-reboot <entry>
with that points to the other OS.
- in the
kicking out the people still logged in when it will arrive a black time window, e.g. following the suggestion of davidgo adding a check in the
crontab
(but again I think it is better to write a little script that reboots with the willed grub option or if it works directlygrub-reboot <entry>
).
Have a nice reading and trying time...
add a comment |
If you can put a solytion in place for this, you can bypass it. If its to frustrate attempts by someone less knowledgeable, you can simply add a line to crontab to reboot every minute between those hours. Possibly along the lines of editing /etc/crontab and adding
* 8-12 * * * root shutdown -h now
If you want/find useful you can give a look to the comment above (mainly the link) about how to change thegrub
behavior to minimize the rebooting.
– Hastur
Feb 8 at 9:44
BTW I love the approach "to frustrate the attempts of someone less expert" ... or they increase their knowledge or they have to be bored to death!:-)
– Hastur
Feb 8 at 10:49
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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
});
}
});
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%2fsuperuser.com%2fquestions%2f1403456%2fhow-can-i-prevent-myself-from-booting-a-certain-distro-in-some-particular-hours%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
What it seems today it can not seem tomorrow :-)
.
You should have been allowed to use date and time related commands on /boot/grub/grub.cfg
editing /etc/grub.d
even if they should rely on the internal PC clock, that has to be protected from users under both OSes and BIOS, as well as the possibility to boot from sources different from those two. Moreover remember that a failure of the motherboard battery may lead to a corrupt time shown by the internal clock.
Give it a look on this ubuntu thread for some more practical hints or to this post for a simple panorama. Hint relays on the datehook
module and the config file (/boot/grub/grub.cfg
)
insmod datehook
if [ "$HOUR" -ge "8" -a "$HOUR" -lt "13" ]; then set default="0" #Manjaro KDE
else set default="1" #Elementary OS
fi
By hands
If you cannot use the grub
features above, you can apply a strategy
to preempt the logging in the wrong time forcing a reboot with a specific selection as described in these other answers. You should put a time check in a script that has to be executed on boot. If the check is not passed you should force a reboot with a different
grub
option.
Main steps are:
- in the
/etc/default/grub
write/checkGRUB_DEFAULT=saved
- Use
grub-set-default
(if you want) for the willed boot option
sudo update-grub
to save it
In the script to be run
grub-reboot <entry>
with that points to the other OS.
- in the
kicking out the people still logged in when it will arrive a black time window, e.g. following the suggestion of davidgo adding a check in the
crontab
(but again I think it is better to write a little script that reboots with the willed grub option or if it works directlygrub-reboot <entry>
).
Have a nice reading and trying time...
add a comment |
What it seems today it can not seem tomorrow :-)
.
You should have been allowed to use date and time related commands on /boot/grub/grub.cfg
editing /etc/grub.d
even if they should rely on the internal PC clock, that has to be protected from users under both OSes and BIOS, as well as the possibility to boot from sources different from those two. Moreover remember that a failure of the motherboard battery may lead to a corrupt time shown by the internal clock.
Give it a look on this ubuntu thread for some more practical hints or to this post for a simple panorama. Hint relays on the datehook
module and the config file (/boot/grub/grub.cfg
)
insmod datehook
if [ "$HOUR" -ge "8" -a "$HOUR" -lt "13" ]; then set default="0" #Manjaro KDE
else set default="1" #Elementary OS
fi
By hands
If you cannot use the grub
features above, you can apply a strategy
to preempt the logging in the wrong time forcing a reboot with a specific selection as described in these other answers. You should put a time check in a script that has to be executed on boot. If the check is not passed you should force a reboot with a different
grub
option.
Main steps are:
- in the
/etc/default/grub
write/checkGRUB_DEFAULT=saved
- Use
grub-set-default
(if you want) for the willed boot option
sudo update-grub
to save it
In the script to be run
grub-reboot <entry>
with that points to the other OS.
- in the
kicking out the people still logged in when it will arrive a black time window, e.g. following the suggestion of davidgo adding a check in the
crontab
(but again I think it is better to write a little script that reboots with the willed grub option or if it works directlygrub-reboot <entry>
).
Have a nice reading and trying time...
add a comment |
What it seems today it can not seem tomorrow :-)
.
You should have been allowed to use date and time related commands on /boot/grub/grub.cfg
editing /etc/grub.d
even if they should rely on the internal PC clock, that has to be protected from users under both OSes and BIOS, as well as the possibility to boot from sources different from those two. Moreover remember that a failure of the motherboard battery may lead to a corrupt time shown by the internal clock.
Give it a look on this ubuntu thread for some more practical hints or to this post for a simple panorama. Hint relays on the datehook
module and the config file (/boot/grub/grub.cfg
)
insmod datehook
if [ "$HOUR" -ge "8" -a "$HOUR" -lt "13" ]; then set default="0" #Manjaro KDE
else set default="1" #Elementary OS
fi
By hands
If you cannot use the grub
features above, you can apply a strategy
to preempt the logging in the wrong time forcing a reboot with a specific selection as described in these other answers. You should put a time check in a script that has to be executed on boot. If the check is not passed you should force a reboot with a different
grub
option.
Main steps are:
- in the
/etc/default/grub
write/checkGRUB_DEFAULT=saved
- Use
grub-set-default
(if you want) for the willed boot option
sudo update-grub
to save it
In the script to be run
grub-reboot <entry>
with that points to the other OS.
- in the
kicking out the people still logged in when it will arrive a black time window, e.g. following the suggestion of davidgo adding a check in the
crontab
(but again I think it is better to write a little script that reboots with the willed grub option or if it works directlygrub-reboot <entry>
).
Have a nice reading and trying time...
What it seems today it can not seem tomorrow :-)
.
You should have been allowed to use date and time related commands on /boot/grub/grub.cfg
editing /etc/grub.d
even if they should rely on the internal PC clock, that has to be protected from users under both OSes and BIOS, as well as the possibility to boot from sources different from those two. Moreover remember that a failure of the motherboard battery may lead to a corrupt time shown by the internal clock.
Give it a look on this ubuntu thread for some more practical hints or to this post for a simple panorama. Hint relays on the datehook
module and the config file (/boot/grub/grub.cfg
)
insmod datehook
if [ "$HOUR" -ge "8" -a "$HOUR" -lt "13" ]; then set default="0" #Manjaro KDE
else set default="1" #Elementary OS
fi
By hands
If you cannot use the grub
features above, you can apply a strategy
to preempt the logging in the wrong time forcing a reboot with a specific selection as described in these other answers. You should put a time check in a script that has to be executed on boot. If the check is not passed you should force a reboot with a different
grub
option.
Main steps are:
- in the
/etc/default/grub
write/checkGRUB_DEFAULT=saved
- Use
grub-set-default
(if you want) for the willed boot option
sudo update-grub
to save it
In the script to be run
grub-reboot <entry>
with that points to the other OS.
- in the
kicking out the people still logged in when it will arrive a black time window, e.g. following the suggestion of davidgo adding a check in the
crontab
(but again I think it is better to write a little script that reboots with the willed grub option or if it works directlygrub-reboot <entry>
).
Have a nice reading and trying time...
edited Feb 8 at 10:38
answered Feb 8 at 9:54
HasturHastur
14k53368
14k53368
add a comment |
add a comment |
If you can put a solytion in place for this, you can bypass it. If its to frustrate attempts by someone less knowledgeable, you can simply add a line to crontab to reboot every minute between those hours. Possibly along the lines of editing /etc/crontab and adding
* 8-12 * * * root shutdown -h now
If you want/find useful you can give a look to the comment above (mainly the link) about how to change thegrub
behavior to minimize the rebooting.
– Hastur
Feb 8 at 9:44
BTW I love the approach "to frustrate the attempts of someone less expert" ... or they increase their knowledge or they have to be bored to death!:-)
– Hastur
Feb 8 at 10:49
add a comment |
If you can put a solytion in place for this, you can bypass it. If its to frustrate attempts by someone less knowledgeable, you can simply add a line to crontab to reboot every minute between those hours. Possibly along the lines of editing /etc/crontab and adding
* 8-12 * * * root shutdown -h now
If you want/find useful you can give a look to the comment above (mainly the link) about how to change thegrub
behavior to minimize the rebooting.
– Hastur
Feb 8 at 9:44
BTW I love the approach "to frustrate the attempts of someone less expert" ... or they increase their knowledge or they have to be bored to death!:-)
– Hastur
Feb 8 at 10:49
add a comment |
If you can put a solytion in place for this, you can bypass it. If its to frustrate attempts by someone less knowledgeable, you can simply add a line to crontab to reboot every minute between those hours. Possibly along the lines of editing /etc/crontab and adding
* 8-12 * * * root shutdown -h now
If you can put a solytion in place for this, you can bypass it. If its to frustrate attempts by someone less knowledgeable, you can simply add a line to crontab to reboot every minute between those hours. Possibly along the lines of editing /etc/crontab and adding
* 8-12 * * * root shutdown -h now
answered Feb 8 at 9:40
davidgodavidgo
45k75392
45k75392
If you want/find useful you can give a look to the comment above (mainly the link) about how to change thegrub
behavior to minimize the rebooting.
– Hastur
Feb 8 at 9:44
BTW I love the approach "to frustrate the attempts of someone less expert" ... or they increase their knowledge or they have to be bored to death!:-)
– Hastur
Feb 8 at 10:49
add a comment |
If you want/find useful you can give a look to the comment above (mainly the link) about how to change thegrub
behavior to minimize the rebooting.
– Hastur
Feb 8 at 9:44
BTW I love the approach "to frustrate the attempts of someone less expert" ... or they increase their knowledge or they have to be bored to death!:-)
– Hastur
Feb 8 at 10:49
If you want/find useful you can give a look to the comment above (mainly the link) about how to change the
grub
behavior to minimize the rebooting.– Hastur
Feb 8 at 9:44
If you want/find useful you can give a look to the comment above (mainly the link) about how to change the
grub
behavior to minimize the rebooting.– Hastur
Feb 8 at 9:44
BTW I love the approach "to frustrate the attempts of someone less expert" ... or they increase their knowledge or they have to be bored to death!
:-)
– Hastur
Feb 8 at 10:49
BTW I love the approach "to frustrate the attempts of someone less expert" ... or they increase their knowledge or they have to be bored to death!
:-)
– Hastur
Feb 8 at 10:49
add a comment |
Thanks for contributing an answer to Super User!
- 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%2fsuperuser.com%2fquestions%2f1403456%2fhow-can-i-prevent-myself-from-booting-a-certain-distro-in-some-particular-hours%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
1
Just an hint: for example you can put a check on the time when you boot in KDE. If it is not passed you can change the boot default option (with zero waiting time) and reboot. Give it a look to this answer. Add a check on
crontab
and reboot if in the wrong time window.– Hastur
Feb 8 at 9:40