DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 15th July 2013
Majorix Majorix is offline
Port Guard
 
Join Date: Apr 2012
Posts: 13
Thanked 0 Times in 0 Posts
Default Have to Source .profile Implicitly

I have just installed OpenBSD 5.3 with XFCE.

I am exporting a PKG_PATH variable in ~/.profile. When I launched a terminal and tried to use this variable (indirectly, via pkg_add) I saw that the variable was not initiated, as such it is blank and pkg_add fails. So I sourced the file myself, and it worked.

Weird thing is, when I restart the terminal same thing happens again. Even after a reboot, each time I launch a terminal I have to source .profile. Shouldn't a terminal take care of this automatically and source it? At least this was the case with other systems I have used in the past.

It happens with both the root and the normal user.

I have googled but did not find any helpful information. Can someone help me?
Reply With Quote
  #2   (View Single Post)  
Old 15th July 2013
LeFrettchen's Avatar
LeFrettchen LeFrettchen is offline
Marveled user
 
Join Date: Aug 2012
Location: Bronvaux, France
Posts: 107
Thanked 0 Times in 0 Posts
Default

You should edit your ~/.profile file here, would be helpful

And providing your dmesg(8) result also
__________________
In case of emergency
Reply With Quote
  #3   (View Single Post)  
Old 15th July 2013
Majorix Majorix is offline
Port Guard
 
Join Date: Apr 2012
Posts: 13
Thanked 0 Times in 0 Posts
Default

Oh I have only added the PKG_PATH export statement in .profile. I will provide the whole file anyway:
Code:
$ cat ~/.profile
# $OpenBSD: dot.profile,v 1.4 2005/02/16 06:56:57 matthieu Exp $
#
# sh/ksh initialization

PATH=$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/games:.
export PATH HOME TERM
export PKG_PATH=ftp://ftp.eu.openbsd.org/pub/OpenBSD/5.3/packages/i386/
And here is the dmesg output:
Code:
$ /sbin/dmesg                                                                  
OpenBSD 5.3 (GENERIC.MP) #58: Tue Mar 12 18:43:53 MDT 2013
    deraadt@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC.MP
cpu0: Intel(R) Atom(TM) CPU N270 @ 1.60GHz ("GenuineIntel" 686-class) 1.60 GHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,NXE,SSE3,DTES64,MWAIT,DS-CPL,EST,TM2,SSSE3,xTPR,PDCM,MOVBE,LAHF,PERF
real mem  = 2138238976 (2039MB)
avail mem = 2092302336 (1995MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 10/21/09, BIOS32 rev. 0 @ 0xf0010, SMBIOS rev. 2.5 @ 0xf0720 (30 entries)
bios0: vendor American Megatrends Inc. version "2204" date 10/21/2009
bios0: ASUSTeK Computer INC. 1000H
acpi0 at bios0: rev 0
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP APIC MCFG OEMB HPET SSDT
acpi0: wakeup devices P0P2(S4) P0P1(S4) HDAC(S4) P0P4(S4) P0P8(S4) P0P5(S4) P0P7(S4) P0P9(S4) P0P6(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: apic clock running at 132MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Atom(TM) CPU N270 @ 1.60GHz ("GenuineIntel" 686-class) 1.60 GHz
cpu1: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,NXE,SSE3,DTES64,MWAIT,DS-CPL,EST,TM2,SSSE3,xTPR,PDCM,MOVBE,LAHF,PERF
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 24 pins
ioapic0: misconfigured as apic 1, remapped to apid 2
acpimcfg0 at acpi0 addr 0xe0000000, bus 0-63
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 3 (P0P5)
acpiprt2 at acpi0: bus 1 (P0P7)
acpiprt3 at acpi0: bus -1 (P0P6)
acpiec0 at acpi0
acpicpu0 at acpi0: C2, C1, PSS
acpicpu1 at acpi0: C2, C1, PSS
acpitz0 at acpi0: critical temperature is 85 degC
acpibat0 at acpi0: BAT0 model "1000H" serial   type LION oem "ASUS"
acpiac0 at acpi0: AC unit online
acpiasus0 at acpi0
acpibtn0 at acpi0: LID_
acpibtn1 at acpi0: SLPB
acpibtn2 at acpi0: PWRB
bios0: ROM list: 0xc0000/0xec00!
cpu0: Enhanced SpeedStep 1597 MHz: speeds: 1600, 1333, 1067, 800 MHz
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "Intel 82945GME Host" rev 0x03
vga1 at pci0 dev 2 function 0 "Intel 82945GME Video" rev 0x03
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
intagp0 at vga1
agp0 at intagp0: aperture at 0xd0000000, size 0x10000000
inteldrm0 at vga1: apic 2 int 16
drm0 at inteldrm0
"Intel 82945GM Video" rev 0x03 at pci0 dev 2 function 1 not configured
azalia0 at pci0 dev 27 function 0 "Intel 82801GB HD Audio" rev 0x02: msi
azalia0: codecs: Realtek ALC269
audio0 at azalia0
ppb0 at pci0 dev 28 function 0 "Intel 82801GB PCIE" rev 0x02: apic 2 int 16
pci1 at ppb0 bus 4
ppb1 at pci0 dev 28 function 1 "Intel 82801GB PCIE" rev 0x02: apic 2 int 17
pci2 at ppb1 bus 3
ale0 at pci2 dev 0 function 0 "Attansic Technology L1E" rev 0xb0: AR8113, msi, address 00:24:8c:86:e1:bd
atphy0 at ale0 phy 0: F1 10/100/1000 PHY, rev. 9
ppb2 at pci0 dev 28 function 3 "Intel 82801GB PCIE" rev 0x02: apic 2 int 19
pci3 at ppb2 bus 1
ral0 at pci3 dev 0 function 0 "Ralink RT2790" rev 0x00: apic 2 int 19, address 00:22:43:6e:c9:8a
ral0: MAC/BBP RT2872 (rev 0x0200), RF RT2720 (MIMO 1T2R)
uhci0 at pci0 dev 29 function 0 "Intel 82801GB USB" rev 0x02: apic 2 int 23
uhci1 at pci0 dev 29 function 1 "Intel 82801GB USB" rev 0x02: apic 2 int 19
uhci2 at pci0 dev 29 function 2 "Intel 82801GB USB" rev 0x02: apic 2 int 18
uhci3 at pci0 dev 29 function 3 "Intel 82801GB USB" rev 0x02: apic 2 int 16
ehci0 at pci0 dev 29 function 7 "Intel 82801GB USB" rev 0x02: apic 2 int 23
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb3 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0xe2
pci4 at ppb3 bus 5
ichpcib0 at pci0 dev 31 function 0 "Intel 82801GBM LPC" rev 0x02: PM disabled
pciide0 at pci0 dev 31 function 2 "Intel 82801GBM SATA" rev 0x02: DMA, channel 0 wired to compatibility, channel 1 wired to compatibility
wd0 at pciide0 channel 0 drive 0: <ST9160310AS>
wd0: 16-sector PIO, LBA48, 152627MB, 312581808 sectors
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 6
usb1 at uhci0: USB revision 1.0
uhub1 at usb1 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb2 at uhci1: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci2: USB revision 1.0
uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb4 at uhci3: USB revision 1.0
uhub4 at usb4 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at ichpcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
mtrr: Pentium Pro MTRR support
uvideo0 at uhub0 port 8 configuration 1 interface 0 "Chicony Electronics Co., Ltd. CNF7129" rev 2.00/15.44 addr 2
video0 at uvideo0
ugen0 at uhub4 port 1 "Broadcom Corp BT-253" rev 2.00/2.41 addr 2
vscsi0 at root
scsibus0 at vscsi0: 256 targets
softraid0 at root
scsibus1 at softraid0: 256 targets
root on wd0a (2077e7da43492a79.a) swap on wd0b dump on wd0b
Reply With Quote
  #4   (View Single Post)  
Old 15th July 2013
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,610
Thanked 214 Times in 189 Posts
Default

Quote:
Originally Posted by Majorix View Post
When I launched a terminal ...
If this is the XFCE Terminal application, you must check "Run command as login shell" in Terminal Preferences.
Reply With Quote
  #5   (View Single Post)  
Old 16th July 2013
Majorix Majorix is offline
Port Guard
 
Join Date: Apr 2012
Posts: 13
Thanked 0 Times in 0 Posts
Default

Thank you! That fixed it. I wonder why it is unchecked by default, I bet most of the people would want it to come enabled.
Reply With Quote
  #6   (View Single Post)  
Old 16th July 2013
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,610
Thanked 214 Times in 189 Posts
Default

I'll guess the answer to your question can be found at http://forum.xfce.org -- there's nothing in the OpenBSD port of XFCE Terminal (/usr/ports/x11/xfce4/terminal/) that modifies any part of the application.
Reply With Quote
  #7   (View Single Post)  
Old 16th July 2013
Majorix Majorix is offline
Port Guard
 
Join Date: Apr 2012
Posts: 13
Thanked 0 Times in 0 Posts
Default

I am still busy configuring the terminal since there is something bugging me, and I wasn't sure if it is related to the XFCE configuration or OpenBSD in general.

My XFCE terminal does not show the working directory and the username/hostname. It only shows # or $ depending on the user.

This is also the case with OpenBSD's virtual terminals, so I wasn't sure if it is caused by XFCE.

There is nothing regarding this in the terminal's configuration menu or on XFCE website. Any ideas how I can fix the problem?
Reply With Quote
  #8   (View Single Post)  
Old 16th July 2013
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 2,873
Thanked 190 Times in 160 Posts
Default

Quote:
Originally Posted by Majorix View Post
My XFCE terminal does not show the working directory and the username/hostname. It only shows # or $ depending on the user.
I don't use XFCE, but this appears to be a ksh(1) issue. Look at the manpage under PS1; OpenBSD's Korn shell allows pneumonics of \u & \w for the username & working directory in the primary shell prompt.
Reply With Quote
  #9   (View Single Post)  
Old 16th July 2013
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,610
Thanked 214 Times in 189 Posts
Default

There is also guidance on setting shell prompts in FAQ 10.18.

(The question on .profile access from xterm(1) shells is discussed in FAQ 8.16.)
Reply With Quote
Old 16th July 2013
Majorix Majorix is offline
Port Guard
 
Join Date: Apr 2012
Posts: 13
Thanked 0 Times in 0 Posts
Default

Thanks for the replies guys.

I didn't know it was related to the PS1 variable, but once I learned that, it was easy to add this line to my .profile
Code:
export PS1="\u@\h:\w\$ "
It does what I need, but with a nasty exception: if I su from a user terminal, it won't load root's .profile for some reason and as such the prompt is just #. If I source .profile the prompt changes to the proper one. What to do?
Reply With Quote
Old 16th July 2013
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,610
Thanked 214 Times in 189 Posts
Default

The su(1) man page describes a "-l" option.

You may find sudo(8) of more utility than su(1).
Reply With Quote
Old 16th July 2013
Majorix Majorix is offline
Port Guard
 
Join Date: Apr 2012
Posts: 13
Thanked 0 Times in 0 Posts
Default

Thanks, you are a big help. Giving the -l parameter does it.
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why doesnot OpenBSD run /etc/profile and ~/.profile ? sw2wolf OpenBSD General 2 28th August 2012 11:26 PM
when and by what is .profile read? kasse FreeBSD General 8 11th September 2008 08:46 AM
working with .profile and history uptonm OpenBSD Security 1 15th August 2008 12:14 PM


All times are GMT. The time now is 03:14 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick