Search Debian Channel Logs

Tuesday, January 31, 2017

#debian channel featuring somiaj, fifthplanet, n4dir, goto-, missmbob, apt,

fifthplanet 2017-01-31 09:15:20
I installed Debian without a GUI and then I installed Xorg and i3wm, how do I make startx run on login?
fifthplanet 2017-01-31 09:15:30
I don't think I want a login manager
fifthplanet 2017-01-31 09:15:49
I'm in a virtual machine
goto- 2017-01-31 09:15:59
Hi. I'm having trouble with my debian+nginx+php-fpm. Somehow the php code is not passed to the fpm socket
goto- 2017-01-31 09:16:25
I knew that there was some easy fix for this, but I can't remember :/
n4dir 2017-01-31 09:16:39
fifthplanet: you want to autologin and get X automatically?
teraflops 2017-01-31 09:16:42
fifthplanet: you don't want to type startx?
fifthplanet 2017-01-31 09:16:52
yup
n4dir 2017-01-31 09:17:28
i don't know. It was possible with sysv, it sure is possible with systemd, but i wouldn't know how.
fifthplanet 2017-01-31 09:18:26
its a ittle lazy I know, but I'm more interested in how to execute something automatically at login
teraflops 2017-01-31 09:19:25
fifthplanet: you need to setup automated login to virtual console firts
n4dir 2017-01-31 09:19:31
i guess on tty-login you would use .profile to automatically do things (say start ssh-agent). But that is a different question
teraflops 2017-01-31 09:19:58
fifthplanet: https://wiki.archlinux.org/index.php?title=Xinit&redirect=no#Autostart_X_at_login
teraflops 2017-01-31 09:20:12
fifthplanet: that works in debian jessie
goto- 2017-01-31 09:20:29
hm
goto- 2017-01-31 09:20:37
I somehow fixed the problem
goto- 2017-01-31 09:20:39
:D
goto- 2017-01-31 09:20:48
I don't know how
fifthplanet 2017-01-31 09:31:08
woohoo it worked
fifthplanet 2017-01-31 09:31:24
there wasn't a .bash_profile but I edited .profile and it worked
fifthplanet 2017-01-31 09:31:36
thanks teraflops
teraflops 2017-01-31 09:31:42
fifthplanet: np
missmbob 2017-01-31 09:32:04
fyi, you could've just created one. or used .bashrc
fifthplanet 2017-01-31 09:32:35
Yeah but there was alerady a .profile and the instructions I was using were for arch
somiaj 2017-01-31 09:32:47
fifthplanet: one thing to note is .profile is read by other shells, so if you have bashisms in it, it could cause issues
fifthplanet 2017-01-31 09:33:13
oh
Randomon 2017-01-31 09:33:39
Hi all. I know it is possible to mount a normal file and treat it like a device using the '-o loop' mount option. The qustion: How could one do the same thing, but reading the file backwards?
Randomon 2017-01-31 09:33:54
So if the file has 'sectors' for example from 1 to 100, make it to be that sector 100 is the first and sector 1 the last?
n4dir 2017-01-31 09:34:09
somiaj: if another shell is the login-shell?
somiaj 2017-01-31 09:34:54
n4dir: correct, .profile is parsed by all shells, though in many cases this isn't an issue if the user only uses bash.
greycat 2017-01-31 09:35:22
Not all shells. csh and tcsh exist, sadly.
somiaj 2017-01-31 09:35:25
hence why .bash_profile exists, to allow bash only stuff.
fifthplanet 2017-01-31 09:35:28
Should I change it?
somiaj 2017-01-31 09:35:40
fifthplanet: if you only use bash it might not be an issue, just pointing it out
greycat 2017-01-31 09:35:46
For some reason I'm not sure I understand, jessie has /etc/skel/.profile instead of /etc/skel/.bash_profile
n4dir 2017-01-31 09:35:51
yeah, but i mean only during login. Not sure if i got that right (profile gets sourced during login, bashrc (csrc, etc) when a new terminal is opened ) ?
greycat 2017-01-31 09:36:25
Depends on how the WM is configured to open the terminal.
somiaj 2017-01-31 09:36:29
n4dir: for bash, unsure if other shells have a difference between login(1) shells and interactive shells, but the top of man bash clarifies this if you are courious.
n4dir 2017-01-31 09:36:37
to put it different, bashisms in .profile, bash is login shell, if i later do; $dash (or whatever), the bashisms in profile shouldn't give problems=
greycat 2017-01-31 09:36:42
In a SANE environment, yes, a WM opens a terminal which opens a NON-login shell which reads a .*rc file
greycat 2017-01-31 09:37:13
But many people configure WMs to open terminals with the -ls (or equivalent) option that runs a LOGIN shell... which causes great confusion.
tw 2017-01-31 09:37:31
Randomon: probably the closest you are going to get without reversing the blocks in the file is dm linear.
tw 2017-01-31 09:38:16
Randomon: there's a perl script in the kernel docs that does reverse ordering of 4M chunks, you could probably make it work for you with smaller (512 byte) chunks.
Randomon 2017-01-31 09:38:42
tw: The idea is exactly to reverse the blocks. So 100 to be treated like the first, 99 like the second, and so on.
n4dir 2017-01-31 09:38:56
as debian came and comes with .profile, i always used that (not that i would often put something in it). might change to .bash_profile, to be safe
tw 2017-01-31 09:39:59
Randomon: that's how it should behave. you'd first set up a loop device with losetup, then you'd provide your mapping table to dmsetup as is done in that script.
somiaj 2017-01-31 09:40:02
yea, thought I don't think the default .profile has any bashims in it, but it does check for bash
tw 2017-01-31 09:40:08
Randomon: https://www.kernel.org/doc/Documentation/device-mapper/linear.txt
Randomon 2017-01-31 09:40:42
tw: I never heared of dm linear. Will check it out. And will see also about the script, but I don't know perl though. But will have a look.
somiaj 2017-01-31 09:40:44
wonder if a bug should be filed for bash to provide /etc/skel/.bash_profile instead
Randomon 2017-01-31 09:41:02
tw: thanks for the link.
tw 2017-01-31 09:41:05
np
n4dir 2017-01-31 09:41:22
somiaj: yeah, two blocks of code, iirc (one adds ~/bin to the PATH; the other i forgot, perhaps sources .bashrc)
somiaj 2017-01-31 09:41:37
n4dir: yup
n4dir 2017-01-31 09:42:34
i added ssh-agent, but thats about it
somiaj 2017-01-31 09:43:43
in most cases in bash, one should modify .bashrc as by default this affects both login and interactive shells due to the source in the default .prfoile
greycat 2017-01-31 09:44:29
~/.profile is only used when you login on a text console, or by ssh, or when you "su -" to your own account for some reason
apt 2017-01-31 09:44:29
okay, greycat
greycat 2017-01-31 09:44:43
apt, forget /.profile
apt 2017-01-31 09:44:43
greycat: i forgot /.profile
n4dir 2017-01-31 09:45:02
hmm, i put ssh-agent in .bashrc. the problem was that it was not available on all new non-login terminals. But perhaps i remember incorrct. Anyway; thats why i put ssh-agen in .profile