Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
06-01-2014, 11:56 AM
|
#46
|
Member
Registered: Aug 2012
Location: Ryomgård, Danmark
Distribution: Slackware64
Posts: 146
Rep:
|
Yea - it looks right, is it executable
Just "echo $QTDIR" and "echo $CPLUS_INCLUDE_PATH"
and you see if that script is called
|
|
|
06-01-2014, 05:07 PM
|
#47
|
Member
Registered: Jan 2012
Location: Directly above the center of the earth
Distribution: Slackware. There's something else?
Posts: 383
Rep:
|
Quote:
Originally Posted by ml4711
Yea - it looks right, is it executable
Just "echo $QTDIR" and "echo $CPLUS_INCLUDE_PATH"
and you see if that script is called
|
Hmmm...looks like it's not working. I got this:
Code:
bash-4.2$ echo $QTDIR
bash-4.2$ echo $CPLUS_INCLUDE_PATH
/usr/lib/qt/include
And it *is* executable. So something, somewhere is messed up, right?
|
|
|
06-02-2014, 02:34 AM
|
#48
|
Member
Registered: Aug 2012
Location: Ryomgård, Danmark
Distribution: Slackware64
Posts: 146
Rep:
|
Quote:
And it *is* executable. So something, somewhere is messed up, right?
|
But for everyone?
The file should have these attributes!
Code:
stat /etc/profile.d/qt.sh
...
Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
...
|
|
|
06-02-2014, 06:11 AM
|
#49
|
Member
Registered: Jan 2012
Location: Directly above the center of the earth
Distribution: Slackware. There's something else?
Posts: 383
Rep:
|
Quote:
Originally Posted by ml4711
But for everyone?
The file should have these attributes!
Code:
stat /etc/profile.d/qt.sh
...
Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
...
|
Yes, it's executable for everyone. I got the same thing you did:
Code:
bash-4.2$ stat /etc/profile.d/qt.sh
...
...
Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Not good, huh?
|
|
|
06-02-2014, 06:38 AM
|
#50
|
Member
Registered: Aug 2012
Location: Ryomgård, Danmark
Distribution: Slackware64
Posts: 146
Rep:
|
Try to source the script, and see if you get errors, or the variables are set
Code:
source /etc/profile.d/qt.sh
echo $QTDIR
If this works, then the script is OK,
but for some reason it is not used, when you login
I am wondering, what about all the other scripts in that directory,
do they also not work, f.ex. lang.sh?
They are all sourced from /etc/profile
What shell do you use - Bourne (and related) shells?
|
|
|
06-02-2014, 02:05 PM
|
#51
|
Member
Registered: Jan 2012
Location: Directly above the center of the earth
Distribution: Slackware. There's something else?
Posts: 383
Rep:
|
Quote:
Originally Posted by ml4711
Try to source the script, and see if you get errors, or the variables are set
Code:
source /etc/profile.d/qt.sh
echo $QTDIR
If this works, then the script is OK,
but for some reason it is not used, when you login
I am wondering, what about all the other scripts in that directory,
do they also not work, f.ex. lang.sh?
They are all sourced from /etc/profile
What shell do you use - Bourne (and related) shells?
|
Okay, here's what I got:
Code:
bash-4.2$ source /etc/profile.d/qt.sh
bash-4.2$ echo $QTDIR
/opt/kde3/lib/qt3
So it seems *that* is working somehow for some reason.
What should I do to see if any of the other scripts are working in /etc/profile.d?
As for shell I use...uuummmm....all I know is I open konsole (same within Krusader, just a konsole)...both use bash (isn't that bourne again shell?).
|
|
|
06-02-2014, 02:55 PM
|
#52
|
Member
Registered: Aug 2012
Location: Ryomgård, Danmark
Distribution: Slackware64
Posts: 146
Rep:
|
Quote:
....all I know is I open konsole (same within Krusader, just a konsole)...
|
Hello again irgunII :-)
This found on Gentoo forum:
Quote:
Hello everyone,
I am running Gentoo with KDE as DE. To log in I use KDM.
So there is never any login shell that can source /etc/profile for me.
The result is that running Konsole doesnt have the values from /etc/profile
because its supposed to get sourced only from a login shell.
|
They advice one solution:
Quote:
Create a bash resource file "$HOME/.bashrc" if you don't have it
and add: "source /etc/profile"
|
This would do it:
Code:
echo "source /etc/profile" >> $HOME/.bashrc
Or if you can find where konsole is called, add the option --ls to it
This make it a login shell, and so the /etc/profile is sourced!
I do not use KDE, so it is not tested - it is just what They on the big net say!
Enjoy
Last edited by ml4711; 06-02-2014 at 02:57 PM.
|
|
|
06-02-2014, 05:57 PM
|
#53
|
Member
Registered: Dec 2004
Location: USA
Distribution: Slackware 12, Slackware64 14.2
Posts: 236
Original Poster
Rep:
|
Or, to change Konsole to always open a login shell, open Konsole and find Settings / Edit current profile. On the General tab change Command from /bin/bash to This has the advantage that it doesn't change things for _all_ bash invocations, only the one from Konsole.
If you're using XFCE Terminal the procedure is a little different. Edit / Preferences / General / check Run command as login shell
For xterm you have to change the xterm.desktop file. When I use it I just do
Code:
bash$ . /etc/profile
Last edited by jamesf; 06-02-2014 at 05:59 PM.
|
|
|
06-02-2014, 09:26 PM
|
#54
|
Member
Registered: Jan 2012
Location: Directly above the center of the earth
Distribution: Slackware. There's something else?
Posts: 383
Rep:
|
@jamesf - Well, I use KDE, and really don't need the login shell, so I have it so I use the gui login screen and goes straight to X. But thanks for the idea and assistance!
@ml4711 - lol...Hi again to you too friend!
Thank you for that information. I'll give that a try and see how things go. I didn't even have enough of an idea what was wrong to ask it on a search engine, so I'm glad you found it. Thanks again too for all the help you've provided. If I ever win the lotto, I'll come over to Denmark, rent me a Harley (I'm disabled and it's the only thing I can get around on that doesn't give me extreme pain, plus, I'm a biker from all the way back in the 70's and hate cages, heh) and buy you a beer...or 20!
|
|
|
06-02-2014, 09:38 PM
|
#55
|
Member
Registered: Dec 2004
Location: USA
Distribution: Slackware 12, Slackware64 14.2
Posts: 236
Original Poster
Rep:
|
Um, my suggestions were for the GUI. Changing to a login shell will cause /etc/profile to execute. So, you make those mods and only the Konsole and Terminal apps cause the shell to be a login shell, leaving other shell modes alone.
|
|
|
06-03-2014, 02:14 AM
|
#56
|
Member
Registered: Aug 2012
Location: Ryomgård, Danmark
Distribution: Slackware64
Posts: 146
Rep:
|
@irgunII
Quote:
Or, to change Konsole to always open a login shell, open Konsole and find Settings / Edit current profile. On the General tab change Command from /bin/bash to
This has the advantage that it doesn't change things for _all_ bash invocations, only the one from Konsole.
|
This advice from jamesf is actually what you need, and it's also the least intrusive solution!
You still have Your GUI Login :-)
The only change You see, is that /etc/profile is sourced, when you start a konsole!
Enjoy
|
|
|
06-03-2014, 01:16 PM
|
#57
|
Member
Registered: Jan 2012
Location: Directly above the center of the earth
Distribution: Slackware. There's something else?
Posts: 383
Rep:
|
Okay...seems I have the idea of what a 'shell' is completely wrong (that really shouldn't be surprising if you guys knew me better, lol), so I've deleted the bash.rc and done it the way jamesf said to do.
Thank you both again for helping me 'fix my stuff', you're good people.
|
|
|
06-03-2014, 04:05 PM
|
#58
|
Member
Registered: Dec 2004
Location: USA
Distribution: Slackware 12, Slackware64 14.2
Posts: 236
Original Poster
Rep:
|
Really off-topic here, but whatevs. ;vD The best discussions are often free-ranging.
A shell, or Command Line Interface (CLI) in this discussion is a command interpreter / user interface. For this definition Slackware comes with multiple shells like csh, tzsh, bash, sh, bsh(?). Then you get a terminal emulator like Konsole, XFCE Terminal, rxvt, urxvt, etc. to provide the 'wrapper' around the shell while in the GUI. There are also GUI shells, but they're basically point-and-click interfaces to the computer. I won't be addressing GUI shells.
For UNIX/Linux shells in general there is the ones I mentioned above, and others listed at http://en.wikipedia.org/wiki/Unix_shell
A discussion of the different types (login, non-login, interactive, non-login interactive) can be found at https://unix.stackexchange.com/quest...on-login-shell
Basically interactive login shells are set up more for human use and as the basis for a GUI environment to start (like KDE, Gnome, etc.) and non-interactive non-login shells are more for script use.
For interactive software development (editing, compiling, linking, installing, testing, repeat) you use an interactive login shell. That usually gives you the rich set of commands like gcc, make, qmake, cmake, etc. in your path that you don't want in the other types of shells.
An example: not making compiler and linker commands available to non-login shells can help prevent some methods of malware spreading because they
compile the malware and then install it. Granted, this was more true years ago, but hey - a good practice is a good practice.
Hope this helps!
Last edited by jamesf; 06-03-2014 at 04:10 PM.
Reason: clarity and i misspelled urxvt
|
|
1 members found this post helpful.
|
06-03-2014, 04:28 PM
|
#59
|
Senior Member
Registered: Dec 2013
Distribution: Slackware
Posts: 1,982
|
Quote:
Originally Posted by jamesf
An example: not making compiler and linker commands available to non-login shells can help prevent some methods of malware spreading because they
compile the malware and then install it. Granted, this was more true years ago, but hey - a good practice is a good practice.
Hope this helps!
|
That's a bit far-fetched. Why wouldn't the malware come pre-compiled ? What if the malware is written in assembly ? Technically you can type in the malware using octal or hex without even an assembler. There are better ways to prevent malware.
Scramdisk seems to be Linux-only, so I don't see how this will save truecrypt as the whole point of truecrypt was its cross-platform nature. I mean I use cryptsetup because I don't use Windoze, but people that do need something cross-platform.
|
|
|
06-03-2014, 09:56 PM
|
#60
|
Member
Registered: Dec 2004
Location: USA
Distribution: Slackware 12, Slackware64 14.2
Posts: 236
Original Poster
Rep:
|
Quote:
Originally Posted by metaschima
That's a bit far-fetched. Why wouldn't the malware come pre-compiled ? What if the malware is written in assembly ? Technically you can type in the malware using octal or hex without even an assembler. There are better ways to prevent malware.
|
No argument, notice that I said that this was more true years ago. The famous Robert Morris worm, considered the first such on the internet (see http://en.wikipedia.org/wiki/Robert_Tappan_Morris) that brought big attention to malware would compile parts of itself if it found itself on a system that the compiled version didn't support. For that to work I'd guess that two parts were downloaded, scripts that checked for a friendly environment and compiled source if needed and a pre-compiled binary for those machines that would support it.
However, it is still good computing practice to compartmentalize permissions. If Bob doesn't need to compile stuff, then Bob can't. If Carol shouldn't 'make install' then she can't. If I don't need into your bank account, then I can't.
Is everyone a member of the root or wheel groups? Same general principle. I was just simplifying a bit for a new user.
P.S. This google search returns multiple recent hits about malware that compiles itself https://www.google.com/#q=malware+%22compiles+itself%22 When I looked the first page of results had hits for Linux, Windows, and Mac OS X. Granted many hits were about the C compiler that inserts a backdoor/malware, but each major OS was represented.
Last edited by jamesf; 06-03-2014 at 10:09 PM.
Reason: Added more examples
|
|
|
All times are GMT -5. The time now is 09:41 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|