LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-23-2017, 10:39 PM   #16
rockymtngeek
LQ Newbie
 
Registered: Jan 2017
Posts: 9

Original Poster
Rep: Reputation: Disabled
Talking


Quote:
Originally Posted by rockymtngeek View Post
I did leave that out in my reply but did enter it as such into crontab -e @reboot/root/noVNC.....etc. I was so excited that it finally worked that I missed typing that into the explanation.
And this time forgot to include the space between @reboot /root/... however the code is entered into crontab correctly and functions. If there is another method that might be good to learn as well. At this point, the pain in my head is finally subsiding and I can breath a sigh of relief. I will take my time and make my instructions correct.

Thanks again!!
 
Old 01-23-2017, 10:42 PM   #17
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Quote:
Also found reference to having this run after the network is up: "network-online.target is a target that actively waits until the nework is "up", where the definition of "up" is defined by the network management software". I just don't know how to implement that either.
Here's a thread relevant to the above quote: http://unix.stackexchange.com/questi...ng-has-started

I'm far from a systemd guru, but it should be simple to implement. First, create a file in /etc/systemd/system named "novnc.service" containing the following:
Code:
[Unit]
Description=novnc service
Wants=network-online.target
After=network-online.target

[Service]
ExecStart=/path/to/noVNC/utils/launch.sh --vnc 127.0.0.1:5901 --listen 80


[Install]
WantedBy=multi-user.target
Then run:
Code:
# systemctl enable novnc.service

Last edited by norobro; 01-23-2017 at 11:22 PM. Reason: Missed the last two lines of novnc.service in copy/paste
 
1 members found this post helpful.
Old 01-23-2017, 11:03 PM   #18
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Mint, Debian, Almalinux
Posts: 899

Rep: Reputation: 119Reputation: 119
Quote:
Originally Posted by rockymtngeek View Post
I did leave that out in my reply but did enter it as such into crontab -e @reboot/root/noVNC.....etc. I was so excited that it finally worked that I missed typing that into the explanation.
I don't think you are understanding what they are asking. it sounds like you are running the command like this

Code:
crontab -e @reboot/root/noVNC
which will throw and error like this
Code:
~ $ crontab -e @reboot/root/noVNC
crontab: usage error: no arguments permitted after this option
usage:    crontab [-u user] file
    crontab [ -u user ] [ -i ] { -e | -l | -r }
        (default operation is replace, per 1003.2)
    -e    (edit user's crontab)
    -l    (list user's crontab)
    -r    (delete user's crontab)
    -i    (prompt before deleting user's crontab)
You see how it through a error message. Anytime you run a command and it fails, give us the results of said message.

Now as to get your command to run via cron. Do this.

# crontab -e

Then it will open up the crontab in the default tab editors. Then put in the line of command you wish to run via cron.

Also you need to be informative about what Linux OS you are running. Crontab may not even be installed. You may need to install it. Your system could have anacron installed which is the same, but different in it's own way.

By the sound of it, it sounds like your rather new to Linux and I'm glad you are working with it. I suggest you check this site out. http://www.tldp.org/ it has loads of helpful information for you.
 
1 members found this post helpful.
Old 01-24-2017, 12:06 AM   #19
rockymtngeek
LQ Newbie
 
Registered: Jan 2017
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jmc1987 View Post
I don't think you are understanding what they are asking. it sounds like you are running the command like this

Code:
crontab -e @reboot/root/noVNC
which will throw and error like this
Code:
~ $ crontab -e @reboot/root/noVNC
crontab: usage error: no arguments permitted after this option
usage:    crontab [-u user] file
    crontab [ -u user ] [ -i ] { -e | -l | -r }
        (default operation is replace, per 1003.2)
    -e    (edit user's crontab)
    -l    (list user's crontab)
    -r    (delete user's crontab)
    -i    (prompt before deleting user's crontab)
You see how it through a error message. Anytime you run a command and it fails, give us the results of said message.

Now as to get your command to run via cron. Do this.

# crontab -e

Then it will open up the crontab in the default tab editors. Then put in the line of command you wish to run via cron.

Also you need to be informative about what Linux OS you are running. Crontab may not even be installed. You may need to install it. Your system could have anacron installed which is the same, but different in it's own way.

By the sound of it, it sounds like your rather new to Linux and I'm glad you are working with it. I suggest you check this site out. http://www.tldp.org/ it has loads of helpful information for you.
Thanks jmc1987 - I can see how it would look like that however the first post by suicidalegroll was very clear. Debian jessie did natively have crontab as part of the o.s. and once I opened it, I was able to input the string he suggested: @reboot /root/noVNC/utils/launch.sh --vnc 127.0.0.1:5901 --listen 80 Which worked once it actually saved it on my second try.

I am very new to linux, I have played around with some other distros over the years on pc platforms but never very much and this is only my second raspberry pi. The first one is just running as a media player in my entertainment center. This one I needed to be a tiny discreet pc in a distant network closet. Thanks for the link, it looks like it is full of great information!!
 
Old 01-24-2017, 08:01 AM   #20
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
LQRocks!
 
Old 01-25-2017, 06:44 AM   #21
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by rockymtngeek View Post
"Launch websockify
Code:
cd noVNC
./utils/launch.sh --vnc 127.0.0.1:5901 --listen 80
at this poing after cd noVNC, issue this
Code:
pwd
and stick that output in front of and lose the dot-slash, eg:
Code:
/etc/noVNC/utils/launch.sh --vnc 127.0.0.1:5901 --listen 80
What are you reading and where please?

Code:
sudo find / -name launch.sh -type f | grep noVNC
should give you the same result (/path/to/) as the modified example:
Code:
/etc/noVNC/utils/launch.sh --vnc 127.0.0.1:5901 --listen 80
Thanks.

Last edited by Habitual; 01-25-2017 at 06:48 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to launch PHP script at startup on RHEL? sneakyimp Linux - Newbie 3 05-15-2013 07:55 PM
[SOLVED] how to launch different application on startup julybrownie Linux - Newbie 2 08-15-2012 01:10 PM
Howto launch script at startup sendas4 Linux - Newbie 2 03-10-2005 11:51 AM
External DVD writing - assistance please neocookie Debian 0 02-15-2005 07:46 AM
Have Firefox Launch X on startup Johnathan4 Linux - Software 1 02-12-2005 11:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration