LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-04-2017, 09:15 AM   #16
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,648

Rep: Reputation: 359Reputation: 359Reputation: 359Reputation: 359

Code:
cd /root/program/bin
I think you are confusing the '/' directory which is the root of all filesystems with
Code:
/root
which is the home directory of root.

A typical path for your user written programs might be something like
Code:
/usr/local/bin/
 
Old 02-04-2017, 10:47 AM   #17
jumperger
LQ Newbie
 
Registered: Oct 2016
Posts: 20

Original Poster
Rep: Reputation: Disabled
I did not write this program, I'm only transfering it to a newer Linux to get support for recent motherboards.
To install the program on Ubuntu 16.04, I copied all the program files to the same path as they were in the original installation on ubuntu 8.
As all the files needed by the program were stored in a folder called program in the root folder, I copied all that stuf to the root folder in my ubuntu 16.04 PC.
Simply copying this folder was not everything I had to do, I also installed missing liraries in 16.04 and created a lot of simlinks to get the program to run.
When doubleclicking the .desktop icon or by launching the program in Terminal everything runs fine.

The only thing I can't get to work is the autostart after boot.

I installed Teamviewer on this Pc and it starts automaticaly after boot, I checked how this works.
There is a systemd unit which starts teamviwer, but in addition to the teamviewerd.system file in /etc/systemd/system there is also a global.conf file in /etc/teamviewer/

In the original setup (ubuntu8) the autostart was made by initd files with following runlevels:
update-rc.d program start 99 2 3 4 5 .
 
Old 02-04-2017, 12:02 PM   #18
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,648

Rep: Reputation: 359Reputation: 359Reputation: 359Reputation: 359
Atrocious naming of the original folder - 'program' indeed!
That's asking for trouble.
 
Old 02-04-2017, 12:31 PM   #19
jumperger
LQ Newbie
 
Registered: Oct 2016
Posts: 20

Original Poster
Rep: Reputation: Disabled
No :-) , the folder is named after the real name of the program, I only used the word program as a placeholder for the real name, which is probably unknown by everybody.

Last edited by jumperger; 02-04-2017 at 12:33 PM.
 
Old 02-04-2017, 01:39 PM   #20
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,648

Rep: Reputation: 359Reputation: 359Reputation: 359Reputation: 359
Is this "program" meant to execute in a GUI environment?
 
Old 02-04-2017, 07:22 PM   #21
jumperger
LQ Newbie
 
Registered: Oct 2016
Posts: 20

Original Poster
Rep: Reputation: Disabled
No , as you can see in my autostart.sh the program may be startet with options:
cd /root/program/bin
./run program -window
run and program are 2 binaries in the /bin folder.
-window is an option stating that the program should execute in a window, when the -window option is set I have the ubuntu GUI in the background, a terminal window where I see the progress of the runing program and a window which displays pictures and videos in reaction to the actions of the ball on the pinball playfield. The "program" gets informations from the switches on the playfield through a parallel cable (LPT1) and in reaction to these informations gives signals to the coils on the playfield and displays the needed video sequence.

When I toggle the -window option to -fullscreen all videos are displayed in fullscreen mode and you can't see the GUI background and terminal window. The -fullscreen option is the standard option used when everything is setup right. When playing the pinball machine you do not have to notice that there's a computer runing behind.
 
Old 02-05-2017, 08:13 AM   #22
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,648

Rep: Reputation: 359Reputation: 359Reputation: 359Reputation: 359
No such program as run exists and program is a directory.
Even if they were both programs, you say that the GUI has been started, this won't happen unless you have logged on and started the GUI in Ubuntu.

Information seems to be released strictly on a need-to-know basis.
 
Old 02-05-2017, 09:06 AM   #23
erik2282
Member
 
Registered: May 2011
Location: TX
Distribution: Debian
Posts: 769

Rep: Reputation: 223Reputation: 223Reputation: 223
https://wiki.archlinux.org/index.php/autostarting
 
Old 02-05-2017, 11:13 AM   #24
jumperger
LQ Newbie
 
Registered: Oct 2016
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by JeremyBoden View Post
No such program as run exists and program is a directory.
Let's use the real name of the program called newcore, all the files which are related to this program are stored in a folder which is also named newcore and has many subfolders e.g. /bin or /scripts or /music or ...
In the /bin subfolder there are 2 binary files, with lozenge shaped blue icons, called run and newcore, both are executable.
In terminal I may start both separately with ./run and ./newcore
Quote:
Even if they were both programs, you say that the GUI has been started, this won't happen unless you have logged on and started the GUI in Ubuntu.
When I switch on my Ubuntu-PC with the POWER-ON/OFF button it comes to the ubuntu GUI without asking for password, only when the screensaver comes up I have to enter my password.

Quote:
Information seems to be released strictly on a need-to-know basis.
I will give you any information you need, but as a newbie I do not know which information and where to find it.
The only thing I realy know, is which command I have to type in terminal to start the programm. I know this because I found the commands by reading all the files in the /scripts folder.
In terminal I type:
sudo su -> I'm not asked for my password
then I change to following directory:
cd /root/newcore/bin -> found this in the autostart.sh script
then I start the ptogram by typing:
./run newcore -fullscreen -> found this in the autostart.sh script
This makes ubuntu GUI disapear and I have only pinball related images and sound on the monitor.
When I quit the pinball program by hitting F1 on the keyboard I come back to ubuntu GUI with terminal window open , which says something about Whatchdog (no idea what this is) and newcore SHUTDOWN and the terminal window closes.

In the newcore installation manual I found that there is also the option -window for starting the program. For my tests while trying to install it on ubuntu 16.04 I mostly used the -window option . With this option set I could see if something was runing in the background or not.
These are all the infos I have, maybe I miss something which doesn't look important to me but could be of great interest for you. You only have to ask, I will share any info I have!

Thank you for trying to help such a newbie as I am
 
Old 02-05-2017, 01:04 PM   #25
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,648

Rep: Reputation: 359Reputation: 359Reputation: 359Reputation: 359
You have Ubuntu set-up to auto-login to some user.
Code:
sudo su -
will give you root permissions.

cd /root/newcore/bin - is newcore really a subdirectory of /root??

To autostart a program for a non-root user, I would create a file
Code:
/home/user_name/.config/autostart/program_name.desktop
You could create such a file - there will be similar examples present.

The program to be run needs to be a script, because you want to do several things.
 
Old 02-05-2017, 02:59 PM   #26
jumperger
LQ Newbie
 
Registered: Oct 2016
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by JeremyBoden View Post
cd /root/newcore/bin - is newcore really a subdirectory of /root??
Yes, I copied the newcore folder with all his content to /root because in the original installation on ubuntu 8 it was also in the /root folder. The /root folder is on the same directory level as /etc , /var , /usr , /bin , /boot , ...

Quote:
Code:
/home/user_name/.config/autostart/program_name.desktop
You could create such a file - there will be similar examples present.
I have alresdy created a .desktop file with an associated icon, this icon is diplayed on my desktop. Doubleclicking the icon starts my pinballsoftware emulation, everything runs fine.
As you suggested I have created an autostart folder in .config and I copied my .desktop file into this autostart folder.
But after reboot my pinballsoftware does not show up.

Quote:
The program to be run needs to be a script, because you want to do several things.
The .desktop file points to my autostart.sh file which I posted earlier , is this a file which you consider being a script?

Code:
#!/bin/bash
#export DISPLAY=:0.0
#xscreensaver-command -exit

cd /root/newcore/bin
./run newcore -window
 
Old 02-05-2017, 05:33 PM   #27
JeremyBoden
Senior Member
 
Registered: Nov 2011
Location: London, UK
Distribution: Debian
Posts: 1,648

Rep: Reputation: 359Reputation: 359Reputation: 359Reputation: 359
You are trying to do two things, but the
Code:
Exec=xxxxxx
in the .desktop file will run only one program.
So you need a script that does both the cd and the run options.

BTW a programmer who uses program names like run & newcore should be shot.
Is there need to run your program with root privileges?
I hope these PC's never get connected to the internet.
 
Old 02-05-2017, 06:11 PM   #28
jumperger
LQ Newbie
 
Registered: Oct 2016
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by JeremyBoden View Post
You are trying to do two things, but the
Code:
Exec=xxxxxx
in the .desktop file will run only one program.
My .desktop file has:
Code:
EXEC=sudo /root/newcore/scripts/autostart.sh
In the EXEC there is only one action
Quote:
So you need a script that does both the cd and the run options.
My script does both, the cd and the start of the 2 programs.
Quote:
BTW a programmer who uses program names like run & newcore should be shot.
That's perhaps the reason why there is no support anymore
Quote:
Is there need to run your program with root privileges?
I think YES , because I have to use the sudo su when launching in terminal and also in the .desktop file.
Quote:
I hope these PC's never get connected to the internet.
Mine will not, once it starts as it should. I do not need to submit my scores to the internet, I'm a miserable player.
 
Old 02-05-2017, 09:12 PM   #29
RadicalDreamer
Senior Member
 
Registered: Jul 2016
Location: USA
Distribution: Slackware64-Current
Posts: 1,021

Rep: Reputation: 508Reputation: 508Reputation: 508Reputation: 508Reputation: 508Reputation: 508
You could try Slackware or Devuan if no solution is found. They don't use systemd. Slackware may never use it and Devuan was created to avoid it.
 
Old 02-05-2017, 10:03 PM   #30
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,844

Rep: Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478
Quote:
Originally Posted by jumperger View Post
The program is an emulator of the software driving a pinball machine built in 1999.
The motherboards of the machines are dieing after nearly 20 years of tough labour.
10 years ago this emulator was created, but is not supported anymore.
To use the emulator on a recent motherboard I had to get it to work on a newer linux . Now with a quad core and ssd the performance of the emulator is realy good.
Only the autostart is a problem, I have to get this to work because the LinuxPC is started at PowerOn of the pinball machine and needs to go directly into the emulator.
1 What are you trying to do with the program?

2 Does it require a GUI?

If it does, then starting at boot time will not work - there is NO GUI available right then, unless you are running the system in "kiosk mode" (and yes, you will have to look up how to run a systemd based system that way). Even then, you don't start it until AFTER the GUI has been started.

3 Does it have to run as a user?

If it does, then the user must exist... and be designated. And if it requires a GUI, then the the user must be logged in, and the proper display defined - some of this is what is done for you with "kiosk mode".
 
  


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
[SOLVED] systemd[1]: Failed to start OpenBSD Secure Shell server during boot pan64 Linux - General 14 10-31-2015 06:14 AM
[SOLVED] Centos 7 - how to start Java app requiring networking on boot with systemd rylan76 Linux - Server 3 06-26-2015 04:30 AM
Boot Delay 30min: systemd-analyze blame systemd-tmpfiles-setup.service BGHolmes Fedora 0 07-27-2011 10:02 AM
[SOLVED] Newbie problem getting Ubuntu s/w to start on triple boot Acer Aspire One netbook meggiedude Linux - Newbie 17 05-19-2011 02:39 AM

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

All times are GMT -5. The time now is 08:36 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration