Automatically Starting A Python Script On Startup After Reboot...

I am running a headless Linux 17 media/NAS server. I have setup and tested the plexconnect script and it works. My only issue is that I can't figure out how to get the script to automatically run on startup. I tried using the GUI, but it doesn't seem to work.

To get it to work, I have to open terminal and navigate to the directory:

/usr/local/lib/PlexConnect/

Then run: sudo ./PlexConnect.py

The window has to remain open in order to keep running (which isn't an issue as it's headless). I'd just like to not have to login and start it each time the power goes out, or is rebooted.

I tried editing the crontab file and adding the following variations with no luck:
@reboot python /usr/local/lib/PlexConnect/PlexConnect.py
@reboot /usr/local/lib/PlexConnect/PlexConnect.py

Neither has worked. Does anyone know what I'm doing wrong?

Thanks!


Similar Content



Dropbox Not Running At Startup

I'm running Debian wheezy. I have Dropbox installed, but it won't run on startup. I downloaded their CLI script dropbox.py, and if I use

Code:
python dropbox.py start

then it starts. I'm trying to use that to get it to run at startup. I have tried editing .profile, and crontab, but it doesn't work and I don't know what else to try. Is it a permissions issue? (I tried making dropbox.py executable and adding python to visudo) or do I need to have some other command to run it at startup?

I appreciate the help!

Centos 7 Startup Script

I have a Centos 7 server which setup by previous system administrator , when this server startup , it will start some service eg. apache , mysql etc, but I could not find the startup script at /etc/rc.local /etc/rc.d/rc.local or /etc/rc.d/init.d , would advise which path will be the startup script keep ?

Thanks

OpenSuSE 12.3 Auto Mount USB

Hi
First post, hope this is in the right forum.

When I plug a USB key into my PC it appears in dolphin but isn't mounted until I click on it.

Running df at the command line doesn't show the USB key until I've clicked it in dolphin then I can access it via the command line.

I'm trying to find a way to automatically mount the key when I boot up.

I found a script that scans /dev/disk/by-label and mounts any disks it finds in to the correct location. This works great from the command line.

I tried adding it to /etc/init.d/boot.local but on a reboot it failed as the USB disk hadn't been detected when boot.local ran.

So where do I need to put this script so it will run when the machine has booted and the USB key has been detected by the OS?

The PC is unattended so I need to be sure that if its remotely rebooted the script is run so the key is mounted.

Thanks

Iceweasel Boot Issue

Ive tried asking on various forums - rasppi etc.

I am running a startup script to start iceweasel on bootup. it opens 2 tabs with pages for internal sites.
Only issue with the device is that it wont be rebooted correctly it has an on and off usb power supply that will kill the power.
I am wondering if there is anything that i can do or put in a startup location or a crontab that on any bootup after power cutting out that it stops the process and then restarts the process/webpages.

Any help would be appreciated

Python FTP Send Command

hello Experts!
need some help here with python FTP. so what i'm trying to do is, from a linux machine, ill be sending over a python script to a windows machine via python ftp. that works fine with no problem. now, i want to execute that python script i sent remotely. im having trouble with that. here's my code to just execute the script:

p.s : please dont suggest other options such as python paramiko due to many network security reasons

Code:
ftp = ftplib.FTP("windows machine name")
ftp.login("username", "password")
ftp.cwd("where\\python\\script\\is kept\\")

ftp.sendcmd("python myscript.py")

but looks like it doesn't recognize that command. how do i accomplish this please?

How To Run A "sudo" Script Without Password

Hi all,
I have a script where every line needs to be prefixed with sudo.
I was advised to run it as $ sudo /path/to/file.sh

This script needs to be scheduled in crontab to run. If I run it as above, will I be prompted for a password?
Also, one of the lines in the script is;
scp -r root@rem_server:/source/dir /local/dir
Does that mean I will have to provide two passwords: one for sudo and one for root?

Thanks,

VitrualBox - How To Show OS Window From Headless ?

Hi All

I'm trying to bring virtual guest from headless mode to gui mode in VirtualBox. But I don't know how to do it. I really appreciate if someone help me on this.

I usually run linux virtual machines in headless mode and connect to it through ssh. I have setup tigervnc-server on linux virtual machine, so that i can connect through vncviewer whenever i want to work on gui.

But recently, one of my friend said, I can also start virtual machine in headless mode in VirtualBox window by holding <SHIFT> key and press Start. Sure it did, it started in headless mode. But, now I don't know how to bring back window again.

Thanks you.

Open File At Startup

how to open a file automatically at startup in centos /redhat.I want to open open some pictures automatically when my red hat boots everytime

How To Run An Application After The Boot ?

Hi, i know this could seems like a "simple" question but after a lot fo try i can't seems to make it works, i am stuck on this. I am working on a sbc6000x board, linux 2.6.24, an embedded system.

I am working on a pretty nice project which when called like this run perfectly :
Code:
cd /bin
./apps

(/bin/apps don't works, it must be ./apps from the directory)

After searching a little about the startup i learned about rc.local and created it in /etc/init.d, rc.local look like this :

Code:
#!bin/sh
# /etc/rc.d/rc.local: Local system initialization script.
#

cd /bin
./apps
cd

Sadly it seems it is never called. I was thinking about maybe add cd /bin, /.apps to the end of the etc/profile but i don't know if profile can run command aside from simple scripts call.

Does anyone has an idea on why this don't work or on how i could do this ?

Is LFS The Right Way To Build A Software Update Disk?

I'm very used to working on a linux machine, programing in Unix terminals all through college. That said, I have never needed to work with linux distributions or doing more than some apt-get software installation.

I need to make a CD. I need a machine to be able to boot from this CD. I would like there to be a unix terminal that runs a script automatically. This script must be able to mount an NFS drive, do simple networking (TCP/IP), and update the software on the machine running it through deleting/adding files.

I guess I need an .iso for a linux distro that has files and a script already on it that can be used to update a bunch of these specific machines?

Should I go through the LFS project in order to learn how to do this?

I'm pretty lost and need some help. Thanks!