« first day (1275 days earlier)      last day (3680 days later) » 

4:00 AM
@FaheemMitha you can do that as long as you have >= 250 rep
 
 
1 hour later…
5:19 AM
@casey Ok, thanks.
 
 
2 hours later…
7:27 AM
Quick question, if I answered a post and there's another answer that evolved into a better one, is it a good idea to delete my answer?
 
7:45 AM
@Patrick
 
here
Your answer should be kept. It has information in it which is not covered in my answer.
 
I actually asked in the chat first (see above) but it's the first time I tried using the chat function. Can someone be invited in the chat by simply typing his nickname?
 
good question, never have tried :-)
 
I don't even see a listing of people in the chat
 
top right, all the icons
theyre all greyed out except for you and I as we're the only ones active
 
7:49 AM
I see
stack exchange looks like a lot of fun
 
It is. The stack exchange network is easily my favorite group of websites
 
8:19 AM
@PavelŠimerda Not in general, no. They have to be in the chat (or have been in the chat recently) to be notified.
 
@FaheemMitha Thanks.
 
 
4 hours later…
12:43 PM
@PavelŠimerda If they've been in the chat room recently that will work (you can tell because their name will autocomplete), otherwise it's complicated: You can create an actual chat room but AFAICT there is no way to invite anyone to it directly. Maybe someone here knows of a way so I can bug anyone, anytime ;)
 
slm
1:36 PM
If any of the regulars have thoughts on restructuring the &
1
Q: Tags [httpd] and [apache]: synonym candidates?

guidoapache seems to have a sligthtly bigger usage preference over httpd, most questions are tagged with both. By the way, I'd prefer apache to be synonym to httpd, not the opposite. EDIT: My point is that Apache is more that just the http server sub-project; apache-httpd would be a better tag. Yet,...

 
Anyone know how I can make this question of mine clearer?
-1
Q: Setting up a router in a virtual machine

Daniel E. ShubI currently am running a number of virtual machines from an Arch Linux based install of Xen. The Dom0 host is running a number of DomU guests including a NAS, a MythTv backend, another full Linux desktop install of Arch, and a Windows XP machine. The Dom0 has a single network interface that is br...

 
1:49 PM
@StrongBad Not in my wheelhouse but maybe you should delete that and ask a new question, using your last comment: "I want all my DomUs and my Dom0 to have internet access and I want all network traffic to go through the DomU router. How many NICs do I need for this and how do I configure them?" You probably do not have to ramble about specifics, just say, "The Dom0 host is running a number of DomU guests", period.
 
@TAFKA'goldilocks' didn't you notice that the A and Q made in this post is made by the same user? unix.stackexchange.com/q/123375/41104
 
@Braiam Yes, that's why I said "Your question...". Almost subversive of me -- and lo, it worked.
I guess someone should flag that as "not an answer" but I don't particularly care TBH.
Although if it turns up in the queue I'd agree.
 
@TAFKA'goldilocks' I just flagged it as possibly needing an account merge...
@TAFKA'goldilocks' Thanks for the suggestion. I can try that as the edit. I would prefer not to delete the question since it does have an answer. although one that is not particularly helpful to me yet.
 
@StrongBad @Braiam Oh you mean those are two separate "Utkarsh Kattishettar" accounts! No I missed that. If a moderator can fix that it would be good, I'll flag too.
 
@TAFKA'goldilocks' Mods can't merge accounts anymore
 
2:02 PM
@TAFKA'goldilocks' I don't know of a way to ping people without commenting on their questions or answer, or adding a comment to comment thread which they are already a part of.
 
Fuck I placed the flag on the wrong page by accident and there is no way to undo it or add another flag indicating the mistake, lol. This place is occasionally glaringly dsyfunctional:
150
Q: Cancel misclicked flags

AlbireoI'm wondering (since it just happened to me), is it possible to "cancel" ("undo", "delete", whatever) a flag I just raised if I misclicked it, so the mods won't waste time? I looked everywhere, but I can't find such a feature.

= "No, we can't do that" WTF
Well, I don't really care either...
 
slm
@TAFKA'goldilocks' - yes this is extremely annoying that you cannot revert or undo on that activity when you can rollback edits and such. Extremely annoying.
 
2:44 PM
@slm But recently nobody cared... 8-) meta.unix.stackexchange.com/questions/2828/…
 
slm
3:03 PM
@HaukeLaging I must of missed that Q. Yeah it's annoying but i guess we shouldn't worry about it 8-)
 
@HaukeLaging Yeah, if I saw somebody else complain about it I'd just shrug. Either they've backed themselves into a corner with the implementation (I dunno if that is public), or they are just lazy, since the excuse is "Oh it doesn't really matter...". Anyway, +1 for asking. BTW, I found some stuff in man bash about where $PS1 comes from originally -- see my edited answer. I'm right :P ...probably
 
3:18 PM
anyone knows if OSX reads bash_profile at boot? unix.stackexchange.com/a/123395/41104
 
@Braiam I seem to remember terdon getting very curious about this and non-standard OSX behaviour. Look for stuff by his with the right tags.
 
cc @terdon ^
@TAFKA'goldilocks' mm... he asked about it, but was more for interactive shells rather than at boot behavior
 
3:57 PM
@Braiam it should, all its shells are login shells so bash should source bash_profile if present.
Oh, you mean during boot? Not sure but probably not since there will be no login session and the scripts are just interpreted directly, .bash_profile is not read for non-interactive shells.
@Braiam yes, the answer you linked to would probably work but not because .bash_profile is sourced at boot, because it is sourced every time you open a terminal window.
 
4:13 PM
openssh (1:6.6p1-2) unstable; urgency=medium

  * If no root password is set, then switch to "PermitRootLogin
    without-password" without asking (LP: #1300127).

 -- Colin Watson <cjwatson@debian.org>  Mon, 31 Mar 2014 12:20:46 +0100
@terdon ok
 
@TAFKA'goldilocks' I guess the main point is: Why are you talking about subshells at all? And what do you consider a subshell?
 
4:39 PM
@HaukeLaging What is it that calls execv()? If it's the kernel, it still uses clone somewhere, which implies it would just inherit the original environment. But obviously that is not what happens. If it's a subshell, then that is an explanation. Your answer as it exists now does not explain anything it just re-describes the phenomenon. You don't provide any references, etc. If you can prove to me that it means something different than what I've said, I'd be happy to eat my words and...
...delete my answer, because there is an ambiguity in here.
However, the bash docs WRT to PS1, etc seem pretty definitive, meaning env is exec'd by a subshell and that subshell is non-interactive.
 
@TAFKA'goldilocks' Interesting view. Because I thought my answer explained everything...
@TAFKA'goldilocks' The question is about the environment differences of commands which are started differently, right?
 
@HaukeLaging All you've said is that processes can be observed to execute with a more limited environment than the shell which executed them. The question is how and why.
@HaukeLaging Very specifically, the question revolves around env, which is an independent process, and my thesis is it's executed by a non-interactive subshell.
 
@TAFKA'goldilocks' IMHO it does not make sense to argue with shell initialization because that effect is specific to shells. The real difference is internal vs. exported variables in a shell, though.
@TAFKA'goldilocks' The shell executes external commands (like env) and internal commands (like set) and that's why these commands see different envorinments. Agree?
 
@HaukeLaging You are saying the difference involves "internal vs. exported variables" -- correct, in part. So where do the variables env and other process come from? export affects subshell environments.
@HaukeLaging Yes, but how does it execute them? It cannot call execv itself, that is the end of the line for a process. And what is the environment in which an executed process exists?
 
@TAFKA'goldilocks' I guess that is wrong (i.e. the wording doesn't make sense): In subshells the environment is the same. No matter whether a variable is exported or not. It seems important to me to tell subshells (internal effects like pipelines) apart from general subprocesses.
@TAFKA'goldilocks' The shell clones (and thus has the same env) and then does execve which "resets" the environment. All internal variables are gone after the execve, even if the new process is the same kind of shell.
 
4:51 PM
@HaukeLaging execve which "resets" the environment -> okay now we are getting somewhere. Resets it to what? (looking in man execv...)
 
Example: PS1="foo "; (echo $PS1) That's what I mean by subshell. Though PS1 is not exported it stays the same.
@TAFKA'goldilocks' The shell sets the environment of an external command to (a) all exported variables) plus (b) variables defined on the command line: LC_ALL=C ls -l
 
@HaukeLaging That's an interesting case too. What I'm getting from the exec() docs is that (e.g.) execvpe() will allow the calling process to redefine the environment. So that's one way it could be "reset". But I think that's not what happens. The subshell that executes it already has a limitied environment. The exec() call does not affect this at all.
 
@TAFKA'goldilocks' "Sets the env" is better wording than "resets the env"
@TAFKA'goldilocks' OK, you think the subshell is limited. Please be precise about what you think is different in the subshell. And again: I think your usage of the term "subshell" is dangerous. A shell being cloned just for the purpose of an execve to a new program can IMHO not usefully be called a "subshell".
 
@HaukeLaging Sets the environment how? Via execvpe(), or by forking and executing a non-interactive subshell.
* Please be precise about what you think is different in the subshell.* As I've said, it's non-interactive. All it's environment characteristics match this thesis exactly. One way or the other, the intention is to have the process execute in the same env as a non-interactive shell. Whether that's because of an intermediate subshell, or execvpe() I dunno. *But it is not automatic magic carried out by just any exec call.
 
@TAFKA'goldilocks' The shell (at least my bash) does an execve which contains the environment as its third parameter.
 
5:00 PM
man execve: The other functions take the environment for the new process image from the external variable environ in the calling process.
There's a big clue then.
 
@TAFKA'goldilocks' That's not part of my man page (2013-07-04). It sounds to me like that execve is the only way to change the environment for a new process. Doesn't your shell use execve?
 
@HaukeLaging Hey take a look at man environ -- note it is not a ringer for man execv.
@HaukeLaging So what does yours say about the environment?
 
@TAFKA'goldilocks' "int execve(const char *filename, char *const argv[], char *const envp[]);" envp is an array of strings, conventionally of the form key=value, which are passed as environment to the new program.
 
Here, try this:
 #include <stdio.h>

    extern char **environ;

    int main (void) {
    	int i;
    	for (i = 0; environ[i] != NULL; i++) {
    		fprintf(stderr,"%s\n", environ[i]);
    	}
    	return 0;
    } `
That's where it's coming from.
Now:
env > env.txt
 
@TAFKA'goldilocks' To me a subshell is (a;b) or foo="$(bar)". I have never thought of these subshells as interactive or non-interactive. But they are whatever the calling shell is. This is usually not done (at least not by me) but: (echo -n "Enter your name: "; read name)`
 
5:10 PM
a.out > aout.txt
diff aout.txt env.txt
These are the same.
So, env gets it's environment from there. Presumably that's inherited from a non-interactive subshell.
Or else the forked (interactive subshell) sets it to the non-interactive values.
 
@TAFKA'goldilocks' env and a.out are started the same way. Of course, the environment is the same.
 
@HaukeLaging Just in case you this point is not clear to you: the shell where you issue the command cannot be the one calling execv(). It MUST be a subshell.
 
@TAFKA'goldilocks' Oh, wow. Now there are not only non-interactive subshells but also non-interactive values...? :-S
@TAFKA'goldilocks' That may be our main difference (as I mentioned several times): Our usage of the term "subshell".
 
@HaukeLaging That's the whole point of the stuff in INVOCATION in man bash! Did you even read it?!?@
 
@TAFKA'goldilocks' Again: In my understanding of the problem / the question the invocation part is irrelevant as it affects a new shell only but not e.g. env. The subshell (as you call it) which does the execve does not do a new invocation procedure.
 
5:16 PM
@HaukeLaging Okay, so you are saying the fork() of the shell which calls exec() is not "a subshell". I can agree w/ that. Except I think that's not quite what actually happens.
I'm saying the shell intentionally forks and executes a new subshell to delimit the environment of the process it's going to execute. This is where I would be wrong ;)
 
@TAFKA'goldilocks' "Happens"? That is terminology? Terminology cannot "happen"...
 
@HaukeLaging True, but what the language refers to does. The word "car" is not a car, but when I say, "Get in the car", I mean a real thing. I may in fact be abusing the term "subshell" in that sense. If it is just a fork of the shell, it's not really a subshell. I guess.
 
@TAFKA'goldilocks' It's the other way round: First there is the fork (or rather: clone). The result is a "temporary subshell" which does the execve. There is no execve to a shell (unless you explicitely call a new shell: > bash).
 
@HaukeLaging Okay, so let's call it a "temporary subshell". It either a) starts with a different environment than its parent, or B) changes the environment to match the "non-interactive" state before it calls execv
 
@TAFKA'goldilocks' I suggest that you make clear in your answer what you mean by "subshell".
 
5:23 PM
@HaukeLaging Yeah, I'm gonna change that and throw in the **environ stuff for good measure, but first I'd like to know how that gets set. It does not contain nothing. It came from somewhere, and it does not match the environment of the original shell BUT hey I got it..
 
@TAFKA'goldilocks' A clone / fork cannot have a different environment. It can just pass a modified one to execve (or modify its own and use another variant of exec).
 
It's the environment the parent shell started with, which it inherited from a non-interactive context.
 
@TAFKA'goldilocks' What does not match the environment of the original shell?
 
@HaukeLaging The environment of the executed process.
 
@TAFKA'goldilocks' When we are talking about fork and exec then "interactive" vs. "non-interactive" doesn't matter. That is on a much higher level.
@TAFKA'goldilocks' You mean env does not show you the environment of the calling shell?
 
5:26 PM
Here's what happens: the interactive shell you use is spawned in a non-interactive context, then it sources files appropriate to it's interactive state. I've read before the shell decides the difference based on it's relationship to a terminal. So the parent shell has PS1 set, and this is also in the fork, but it is not in **environ.
@HaukeLaging No, that's the whole point of the question. It does not contain $PS1, but if you echo $PS1 in the same shell, there it is. An environment variable.
 
@TAFKA'goldilocks' PS1 is technically not part of the shell environment (i.e. you don't see it in /proc/$$/environ). You can use PS1 nonetheless because it is an internal shell variable.
@TAFKA'goldilocks' If you export PS1 then the environment of the shell is not changed. But if an external command is called then those variables which have been marked as exported are copied to the envp[] array of execve.
 
@HaukeLaging You're repeating the observation again. So where does /proc/$$/environ come from?
Magic? Thin air? OS gremlins?
It's been inherited from the shell, which originally got it from a non-interactive context.
 
@TAFKA'goldilocks' Every environment is the result of the environment with which that process was started plus the changes it made. I don't know whether PID 1 initially has an environment.
@TAFKA'goldilocks' I think we are clear now. And I have to leave for a while anyway.
 
5:43 PM
@HaukeLaging PID 1 initially has an environment No, not much of one. But along the way it executes shells, e.g., your login, which is interactive. But the shell which (e.g.) X executes via startx is non-interactive.
And: the interactive parts are never sourced into **environ.
 
6:33 PM
@HaukeLaging Okay, refined, updated, and definitive:
2
A: Understanding environmental variables in different contexts

TAFKA 'goldilocks'The primary issue here -- which accounts for why, e.g., $PS1 is not reported by env -- is that env is reporting from a non-interactive environment. Processes are executed from a fork of your interactive shell, but there's a subtlety involved in how their environment is set: It's actually inherit...

I've deleted my comments which applied to the previous version, and the one on your A. Would much appreciate it if you do the same since they now do not make much sense.
 
 
1 hour later…
7:59 PM
@terdon Someone commented on biostars. biostars.org/p/97086
 

« first day (1275 days earlier)      last day (3680 days later) »