process runnig in terminal

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
samiel60
Level 3
Level 3
Posts: 129
Joined: Thu Apr 13, 2017 1:03 pm

process runnig in terminal

Post by samiel60 » Wed Jul 11, 2018 3:28 pm

Using gnome terminal, every thing I do I receive the following message:

Code: Select all

A process in this terminal is still running. Closing the terminal will interrupt the process
even if there are no processes ongoing, f.e. after a simple $ ls
What's the matter?
thanx
s

samiel60
Level 3
Level 3
Posts: 129
Joined: Thu Apr 13, 2017 1:03 pm

Re: process runnig in terminal

Post by samiel60 » Thu Jul 12, 2018 4:59 pm

none has my same problem?

Mute Ant
Level 13
Level 13
Posts: 4926
Joined: Tue Sep 03, 2013 7:45 pm

Re: process runnig in terminal

Post by Mute Ant » Thu Jul 12, 2018 5:04 pm

I guess the window holding the terminal is still running the 'bash' binary. You can exit bash...
o Using a Ctrl+D keypress
...or...
o Using the exit command.
2018-10-23 Rock on Tommy productions presents the Librarian Chorus in Here Comes the Bride...
Ook ook ook ook: Ook ook ook ook: Ook ook ook ook ook: Ook ook ook ook.

gm10
Level 11
Level 11
Posts: 3535
Joined: Thu Jun 21, 2018 5:11 pm

Re: process runnig in terminal

Post by gm10 » Thu Jul 12, 2018 6:01 pm

samiel60 wrote:
Thu Jul 12, 2018 4:59 pm
none has my same problem?
If that happens after opening the terminal window, typing ls and then trying to close it? No, that shouldn't or even wouldn't happen. My guess is you're leaving some important steps out in your description of what you're doing.

samiel60
Level 3
Level 3
Posts: 129
Joined: Thu Apr 13, 2017 1:03 pm

Re: process runnig in terminal

Post by samiel60 » Mon Jul 16, 2018 6:08 pm

An example. I open my machine, no other processes. I open the console and launch

Code: Select all

samiel@darkstar:~$ su -
Password: 
root@darkstar:~# tlmgr update  --self --all --reinstall-forcibly-removed --repository http://mirror.ctan.org/systems/texlive/tlnet
tlmgr: package repository http://ctan.mirror.garr.it/mirrors/CTAN/systems/texlive/tlnet (verified)
tlmgr: saving backups to /usr/local/texlive/2018/tlpkg/backups
[1/4, ??:??/??:??] update: pxjahyper [105k] (46440 -> 48207) ... done
[2/4, 00:00/00:00] update: texlive-docindex [237k] (48194 -> 48205) ... done
[3/4, 00:01/00:02] update: texlive-scripts [118k] (48162 -> 48205) ... done
[4/4, 00:02/00:03] update: todonotes [439k] (48181 -> 48208) ... done
running mktexlsr ...
done running mktexlsr.
running mtxrun --generate ...
done running mtxrun --generate.
tlmgr: package log updated: /usr/local/texlive/2018/texmf-var/web2c/tlmgr.log
Now I try to close the console windows with the mouse and receive that message.
If I give "exit" before, ne message. But updating LaTeX is already finished,...

User avatar
smurphos
Level 7
Level 7
Posts: 1678
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: process runnig in terminal

Post by smurphos » Mon Jul 16, 2018 11:52 pm

The process su is running until you explicitly end it using exit.

User avatar
Snafu
Level 2
Level 2
Posts: 64
Joined: Tue Mar 13, 2018 7:01 am
Location: Australia

Re: process runnig in terminal

Post by Snafu » Tue Jul 17, 2018 12:57 am

But updating LaTeX is already finished,...
When a process finishes your prompt will reappear
When all else fails follow the instructions

gm10
Level 11
Level 11
Posts: 3535
Joined: Thu Jun 21, 2018 5:11 pm

Re: process runnig in terminal

Post by gm10 » Tue Jul 17, 2018 2:21 am

samiel60 wrote:
Mon Jul 16, 2018 6:08 pm
If I give "exit" before, ne message. But updating LaTeX is already finished,...
As smurphos said, you launched su, until you exit that it remains running. That's why it's preferable to use the sudo prefix to launch a command that you need to run with elevated privileges.

samiel60
Level 3
Level 3
Posts: 129
Joined: Thu Apr 13, 2017 1:03 pm

Re: process runnig in terminal

Post by samiel60 » Tue Jul 17, 2018 4:12 am

ahhhhhhhhhhhh, I did't imagine so...
strange, for in debian I've not this situation!
thanx !!

samiel60
Level 3
Level 3
Posts: 129
Joined: Thu Apr 13, 2017 1:03 pm

Re: process runnig in terminal

Post by samiel60 » Tue Jul 17, 2018 10:48 am

but sudo is as su or su - ?

User avatar
smurphos
Level 7
Level 7
Posts: 1678
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: process runnig in terminal

Post by smurphos » Tue Jul 17, 2018 10:53 am

samiel60 wrote:
Tue Jul 17, 2018 10:48 am
but sudo is as su or su - ?
Nope - sudo temporarily gives your user root privileges but does not change the user. su switches to the root user.

gm10
Level 11
Level 11
Posts: 3535
Joined: Thu Jun 21, 2018 5:11 pm

Re: process runnig in terminal

Post by gm10 » Tue Jul 17, 2018 11:16 am

samiel60 wrote:
Tue Jul 17, 2018 10:48 am
but sudo is as su or su - ?
sudo is basically like su -c, except slightly more convenient to use.

Also sudo doesn't need the root password, just an account that's part of the sudo group. In fact, Ubuntu has root login disabled by default.

samiel60
Level 3
Level 3
Posts: 129
Joined: Thu Apr 13, 2017 1:03 pm

Re: process runnig in terminal

Post by samiel60 » Tue Jul 17, 2018 1:43 pm

I asked because su starts an interactive non-login shell, so it reads, only, if present, ~ /.bashrc;
the environment variables remain almost unchanged compared to those of the user
from whose shell the command was launched; the immediate consequence is that we find ourselves root
in the same starting directory. You can see it considering, for example, the fact that, giving up
and listed the variables with the env command, the USER entry continues to give the user name, while
from the whoami command it is root.
On the other hand, su - starts a login shell, so it reads all the files
configuration (ie / etc / profile, ~ /.profile, ~ /.bash_profile, ~ /.bash_login and - when
logout - ~ /.bash_logout; as a result all the variables are reset to root of environment.

gm10
Level 11
Level 11
Posts: 3535
Joined: Thu Jun 21, 2018 5:11 pm

Re: process runnig in terminal

Post by gm10 » Tue Jul 17, 2018 1:56 pm

You are looking for sudo -s and sudo -i, respectively.

samiel60
Level 3
Level 3
Posts: 129
Joined: Thu Apr 13, 2017 1:03 pm

Re: process runnig in terminal

Post by samiel60 » Tue Jul 17, 2018 2:43 pm

thanx for your explanation!
just what i was looking for :)

s

gm10
Level 11
Level 11
Posts: 3535
Joined: Thu Jun 21, 2018 5:11 pm

Re: process runnig in terminal

Post by gm10 » Tue Jul 17, 2018 2:45 pm

just note that either of those two options, if you use them on their own and not followed by a command, will start a root shell and thus get you back to your original problem. you'll keep getting that warning unless you exit out of the root shell first.

you don't usually need a root shell though, that's what the original recommendation for sudo as a prefix before a command was about.

samiel60
Level 3
Level 3
Posts: 129
Joined: Thu Apr 13, 2017 1:03 pm

Re: process runnig in terminal

Post by samiel60 » Tue Jul 17, 2018 2:52 pm

an example. I install TexLivE. I put in /etc/profile the path for executables,
read that file with

Code: Select all

source
command. if I make all with

Code: Select all

su
the system doesn't find the executables, if I make all with

Code: Select all

su -
it finds all and I can upgrade TexLivE without reboot...

gm10
Level 11
Level 11
Posts: 3535
Joined: Thu Jun 21, 2018 5:11 pm

Re: process runnig in terminal

Post by gm10 » Tue Jul 17, 2018 3:22 pm

But that's your own fault then for configuring it only for the root shell. The system-wide path variable is defined in /etc/environment. Although if you installed your program to a standard location you'd never have to change the path, anyway.

Also if you just need to pass a temporary path to a program you can always env PATH="/TEMPPATH:$PATH" program.

Last but not least, sudo -i program will handle your current way of doing things but without having to open a root shell.

samiel60
Level 3
Level 3
Posts: 129
Joined: Thu Apr 13, 2017 1:03 pm

Re: process runnig in terminal

Post by samiel60 » Wed Jul 18, 2018 9:45 pm

the standard is to write LaTeX path in /etc/profile and in ~/.bashrc

Code: Select all

PATH=/usr/local/texlive/2018/bin/x86_64-linux:$PATH; export PATH
MANPATH=/usr/local/texlive/2018/texmf-dist/doc/man:$MANPATH; export MANPATH
INFOPATH=/usr/local/texlive/2018/texmf-dist/doc/info:$INFOPATH; export INFOPATH

Post Reply

Return to “Software & Applications”