Startup Application and @reboot cron not firing - what to look for?












1















I have an issue with my dual monitor setup: one is touchscreen and the other is not - the touch input correlates across both displays instead of just one. I can resolve the issue by mapping the input to the correct display using the following command:



xinput map-to-output 11 DP-1



I would like this command to fire up on startup automatically. I've tried adding it as a cron job in both my user and root crontabs as follows:



@reboot xinput map-to-output 11 DP-1



and I've also added it as a script:



@reboot /home/imperial/.scripts/map_touchscreen.sh



Neither option worked. I also tried both options (without the @reboot) in Ubuntu's startup applications gui.



Why isn't my command firing - where should I be looking to find the problem?










share|improve this question























  • Maybe try adding in a small delay for when they start. I was having an issue similar so I added maybe a 5 to 10 second delay. I think it was trying to start it too soon and couldn't do it, so it just passed it over. So maybe try one of yours like @reboot bash -c 'sleep 10 && /home/imperial/.scripts/map_touchscreen.sh'

    – Terrance
    Jan 8 at 5:36













  • Good idea but no luck! I pushed the sleep all the way to 60 and came back to it after a while, still hadn't fired.

    – raicho
    Jan 8 at 12:21











  • As a further piece of info, I just tried launching the script from a .desktop file as an interim solution and the command also did not execute. However if I execute the script from bash it works.....?!

    – raicho
    Jan 8 at 14:20











  • If you look at the /etc/crontab file which does start up, you will see that there is SHELL and PATH before it runs the commands in the crontab file. You can try adding the full paths in your script to like /usr/bin/xinput so it knows where the file is.

    – Terrance
    Jan 8 at 22:14
















1















I have an issue with my dual monitor setup: one is touchscreen and the other is not - the touch input correlates across both displays instead of just one. I can resolve the issue by mapping the input to the correct display using the following command:



xinput map-to-output 11 DP-1



I would like this command to fire up on startup automatically. I've tried adding it as a cron job in both my user and root crontabs as follows:



@reboot xinput map-to-output 11 DP-1



and I've also added it as a script:



@reboot /home/imperial/.scripts/map_touchscreen.sh



Neither option worked. I also tried both options (without the @reboot) in Ubuntu's startup applications gui.



Why isn't my command firing - where should I be looking to find the problem?










share|improve this question























  • Maybe try adding in a small delay for when they start. I was having an issue similar so I added maybe a 5 to 10 second delay. I think it was trying to start it too soon and couldn't do it, so it just passed it over. So maybe try one of yours like @reboot bash -c 'sleep 10 && /home/imperial/.scripts/map_touchscreen.sh'

    – Terrance
    Jan 8 at 5:36













  • Good idea but no luck! I pushed the sleep all the way to 60 and came back to it after a while, still hadn't fired.

    – raicho
    Jan 8 at 12:21











  • As a further piece of info, I just tried launching the script from a .desktop file as an interim solution and the command also did not execute. However if I execute the script from bash it works.....?!

    – raicho
    Jan 8 at 14:20











  • If you look at the /etc/crontab file which does start up, you will see that there is SHELL and PATH before it runs the commands in the crontab file. You can try adding the full paths in your script to like /usr/bin/xinput so it knows where the file is.

    – Terrance
    Jan 8 at 22:14














1












1








1








I have an issue with my dual monitor setup: one is touchscreen and the other is not - the touch input correlates across both displays instead of just one. I can resolve the issue by mapping the input to the correct display using the following command:



xinput map-to-output 11 DP-1



I would like this command to fire up on startup automatically. I've tried adding it as a cron job in both my user and root crontabs as follows:



@reboot xinput map-to-output 11 DP-1



and I've also added it as a script:



@reboot /home/imperial/.scripts/map_touchscreen.sh



Neither option worked. I also tried both options (without the @reboot) in Ubuntu's startup applications gui.



Why isn't my command firing - where should I be looking to find the problem?










share|improve this question














I have an issue with my dual monitor setup: one is touchscreen and the other is not - the touch input correlates across both displays instead of just one. I can resolve the issue by mapping the input to the correct display using the following command:



xinput map-to-output 11 DP-1



I would like this command to fire up on startup automatically. I've tried adding it as a cron job in both my user and root crontabs as follows:



@reboot xinput map-to-output 11 DP-1



and I've also added it as a script:



@reboot /home/imperial/.scripts/map_touchscreen.sh



Neither option worked. I also tried both options (without the @reboot) in Ubuntu's startup applications gui.



Why isn't my command firing - where should I be looking to find the problem?







18.04 cron startup startup-applications






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 8 at 5:07









raichoraicho

2113




2113













  • Maybe try adding in a small delay for when they start. I was having an issue similar so I added maybe a 5 to 10 second delay. I think it was trying to start it too soon and couldn't do it, so it just passed it over. So maybe try one of yours like @reboot bash -c 'sleep 10 && /home/imperial/.scripts/map_touchscreen.sh'

    – Terrance
    Jan 8 at 5:36













  • Good idea but no luck! I pushed the sleep all the way to 60 and came back to it after a while, still hadn't fired.

    – raicho
    Jan 8 at 12:21











  • As a further piece of info, I just tried launching the script from a .desktop file as an interim solution and the command also did not execute. However if I execute the script from bash it works.....?!

    – raicho
    Jan 8 at 14:20











  • If you look at the /etc/crontab file which does start up, you will see that there is SHELL and PATH before it runs the commands in the crontab file. You can try adding the full paths in your script to like /usr/bin/xinput so it knows where the file is.

    – Terrance
    Jan 8 at 22:14



















  • Maybe try adding in a small delay for when they start. I was having an issue similar so I added maybe a 5 to 10 second delay. I think it was trying to start it too soon and couldn't do it, so it just passed it over. So maybe try one of yours like @reboot bash -c 'sleep 10 && /home/imperial/.scripts/map_touchscreen.sh'

    – Terrance
    Jan 8 at 5:36













  • Good idea but no luck! I pushed the sleep all the way to 60 and came back to it after a while, still hadn't fired.

    – raicho
    Jan 8 at 12:21











  • As a further piece of info, I just tried launching the script from a .desktop file as an interim solution and the command also did not execute. However if I execute the script from bash it works.....?!

    – raicho
    Jan 8 at 14:20











  • If you look at the /etc/crontab file which does start up, you will see that there is SHELL and PATH before it runs the commands in the crontab file. You can try adding the full paths in your script to like /usr/bin/xinput so it knows where the file is.

    – Terrance
    Jan 8 at 22:14

















Maybe try adding in a small delay for when they start. I was having an issue similar so I added maybe a 5 to 10 second delay. I think it was trying to start it too soon and couldn't do it, so it just passed it over. So maybe try one of yours like @reboot bash -c 'sleep 10 && /home/imperial/.scripts/map_touchscreen.sh'

– Terrance
Jan 8 at 5:36







Maybe try adding in a small delay for when they start. I was having an issue similar so I added maybe a 5 to 10 second delay. I think it was trying to start it too soon and couldn't do it, so it just passed it over. So maybe try one of yours like @reboot bash -c 'sleep 10 && /home/imperial/.scripts/map_touchscreen.sh'

– Terrance
Jan 8 at 5:36















Good idea but no luck! I pushed the sleep all the way to 60 and came back to it after a while, still hadn't fired.

– raicho
Jan 8 at 12:21





Good idea but no luck! I pushed the sleep all the way to 60 and came back to it after a while, still hadn't fired.

– raicho
Jan 8 at 12:21













As a further piece of info, I just tried launching the script from a .desktop file as an interim solution and the command also did not execute. However if I execute the script from bash it works.....?!

– raicho
Jan 8 at 14:20





As a further piece of info, I just tried launching the script from a .desktop file as an interim solution and the command also did not execute. However if I execute the script from bash it works.....?!

– raicho
Jan 8 at 14:20













If you look at the /etc/crontab file which does start up, you will see that there is SHELL and PATH before it runs the commands in the crontab file. You can try adding the full paths in your script to like /usr/bin/xinput so it knows where the file is.

– Terrance
Jan 8 at 22:14





If you look at the /etc/crontab file which does start up, you will see that there is SHELL and PATH before it runs the commands in the crontab file. You can try adding the full paths in your script to like /usr/bin/xinput so it knows where the file is.

– Terrance
Jan 8 at 22:14










0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1107882%2fstartup-application-and-reboot-cron-not-firing-what-to-look-for%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
















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • 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%2faskubuntu.com%2fquestions%2f1107882%2fstartup-application-and-reboot-cron-not-firing-what-to-look-for%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







Popular posts from this blog

Human spaceflight

Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

張江高科駅