Re: User tasks in ~/.logout

2011-10-11 Thread Karl Vogel
>> On Tue, 11 Oct 2011, Polytropon wrote:

P> I have some users who I want to "schedule" a specific job for which gets
P> executed on their user account. For some of them, it will be twice a
P> day, for others just once a month. It should happen at logout time.

   If using the ~/.logout file works, fine, but...

P> The only thing is to educate users to...

   ...may the deity of your choice help you.  How about this?

   1.  Run the "onlogout" program below once a minute from cron.  You can
   run it as root, since it uses "last" to figure out who's logged out
   recently, and "su" to run something as that user.  I opened a new xterm,
   connected via ssh to a BSD box, and closed the window without logging
   out; "last" showed my session properly, so your users probably won't
   need to change the way they do things.

   2.  "onlogout" runs another script called "runone", which uses "lockf"
   to make sure that only one instance is running for a given user at
   a time.  The example below just prints the date and sleeps for a
   few seconds to demonstrate the locking, but you could personalize
   it by running "~/.disconnect" if it exists; "su -l" should set the
   environment properly.

   "onlogout" keeps the previous most recent 20 lines from "last" to see
   what's changed since the previous run.  If your system is really active,
   you'll have to tweak that.

   Over-engineered?  Probably, but the combination of no user education plus
   safely running *one* copy of a backup job (or whatever) on user logout
   might be worth it.

-- 
Karl Vogel  I don't speak for the USAF or my company
Handy engineering conversions: 1000 aches = 1 kilohurtz

---
#!/bin/ksh
# new

if test -f old
then
list=$(diff old new | grep -v 'still logged in' |
   grep '^>' | awk '{print $2}' | sort -u)
else
mv new old
exit 0
fi

# Start a specific job for each one.
for name in $list
do
su -l $name -c '/usr/sbin/daemon /path/to/runone'
done

mv new old
exit 0

---
#!/bin/ksh
#http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Turning system accounting data into money

2011-10-11 Thread Jonathan Vomacka
Ever heard of bold_or_underline?

On Oct 11, 2011 10:06 AM, "Polytropon"  wrote:
>
> This is _not_ a spam message trying to sell something
> stupid to the list. I'm just searching for a solution
> to turn consumed computing resources into a number and
> a currency symbol. :-)
>
> Reason: A growing amount of (my) customers seems to
> like this concept: They speed a low fee for access to
> systems and applications, and they want to pay according
> to what they did with that system. The access fee covers
> access and some basic services (backup & quota), and for
> anything "more advanced" they want to be charged per
> "units" used, or per "consumed resources". This can be dialog
> time (SSH), disk I/O, disk occupied, pages printed (can happen)
> or pages required to print on exceptional specific forms
> (can happen once or twice a year and is charged with an
> additional fee for fold, staple & mutilate).
>
> Sounds stupid? I have _real_ customers intendedly
> requesting that payment model (instead of "just pay
> amount n Euro a month and do whatever you like").
>
> Accidentally, I remembered history.
>
> So I thought: This funcitonality has been present on
> UNIX systems for many decades. But _how_ to use it? I
> know there's the command set for accounting, for example
> the "ac" command. But what does its output "total 7264.15"
> mean? There also are "acct" (process accounting), "sa"
> (for system accounting) and "pac" (for printer accounting,
> just dooesn't seem to work with CUPS).
>
> I'd also like to use the /etc/csh.logout resp. ~/.logout
> mechanism. When a user logs in, he will be presented the
> program he uses (or a menu, in case he uses different ones).
> This can also be a regular "remote desktop" session. When
> he logs out, a message should be displayed that informs
> him how much will be charged for the session. At the end
> of the month, he should get an invoice with the proper
> accumulated amount.
>
> For example, if a user wishes to issue a "make a backup
> _now_, because I intendedly want _this_ current state
> backed up _now_", this will be seen as additional I/O
> load and disk occupation (because it's handled aside of
> the regular backup runs that should be part of the
> "basic package" charged with the "conneciton fee").
> Or as I said, he issues printing for stuff he cannot
> print at home, so he will be charged for 500 pages.
> And in case he transfers 10 GB data in, and 10 GB data
> out, he will be charged for that traffic, as well as
> for the I/O.
>
> The sessions in questions will be SSH sessions (text mode)
> as well as SSH/X sessions (remote desktops).
>
> Maybe someone already uses something similar he wants
> to share? Suggestions and inspirations are welcome.
>
>
>
>
> --
> Polytropon
> Magdeburg, Germany
> Happy FreeBSD user since 4.0
> Andra moi ennepe, Mousa, ...
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "
freebsd-questions-unsubscr...@freebsd.org"
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Where to go for xorg information

2011-10-11 Thread doug

On Tue, 11 Oct 2011, Maciej Milewski wrote:


Dnia wtorek, 11 pa?dziernika 2011 11:52:15 d...@safeport.com pisze:

Anyway my question: I imderstand that the FreeBSD Foundation is/was
sponsoring coding for the Intel Ironlake chip. Does anyone know the status
of this or perhaps where to inquire about the project status?
_
Douglas Denault


This should say something:
http://wiki.freebsd.org/Intel_GPU

Maciej


Thanks, UTFM is a subset of FTFM. Understanding is a work in progress.
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Turning system accounting data into money

2011-10-11 Thread Christopher J. Ruwe
On Tue, 11 Oct 2011 16:06:19 +0200
Polytropon  wrote:

> This is _not_ a spam message trying to sell something
> stupid to the list. I'm just searching for a solution
> to turn consumed computing resources into a number and
> a currency symbol. :-)
> 
> Reason: A growing amount of (my) customers seems to
> like this concept: They speed a low fee for access to
> systems and applications, and they want to pay according
> to what they did with that system. The access fee covers
> access and some basic services (backup & quota), and for
> anything "more advanced" they want to be charged per
> "units" used, or per "consumed resources". This can be dialog
> time (SSH), disk I/O, disk occupied, pages printed (can happen)
> or pages required to print on exceptional specific forms
> (can happen once or twice a year and is charged with an
> additional fee for fold, staple & mutilate).
> 
> Sounds stupid? I have _real_ customers intendedly
> requesting that payment model (instead of "just pay
> amount n Euro a month and do whatever you like").
> 
> Accidentally, I remembered history.
> 
> So I thought: This funcitonality has been present on
> UNIX systems for many decades. But _how_ to use it? I
> know there's the command set for accounting, for example
> the "ac" command. But what does its output "total 7264.15"
> mean? There also are "acct" (process accounting), "sa"
> (for system accounting) and "pac" (for printer accounting,
> just dooesn't seem to work with CUPS).
> 
> I'd also like to use the /etc/csh.logout resp. ~/.logout
> mechanism. When a user logs in, he will be presented the
> program he uses (or a menu, in case he uses different ones).
> This can also be a regular "remote desktop" session. When
> he logs out, a message should be displayed that informs
> him how much will be charged for the session. At the end
> of the month, he should get an invoice with the proper
> accumulated amount.
> 
> For example, if a user wishes to issue a "make a backup
> _now_, because I intendedly want _this_ current state
> backed up _now_", this will be seen as additional I/O
> load and disk occupation (because it's handled aside of
> the regular backup runs that should be part of the
> "basic package" charged with the "conneciton fee").
> Or as I said, he issues printing for stuff he cannot
> print at home, so he will be charged for 500 pages.
> And in case he transfers 10 GB data in, and 10 GB data
> out, he will be charged for that traffic, as well as
> for the I/O.
> 
> The sessions in questions will be SSH sessions (text mode)
> as well as SSH/X sessions (remote desktops).
> 
> Maybe someone already uses something similar he wants
> to share? Suggestions and inspirations are welcome.
> 
> 

Cannot be of any direct help, but ...

You remember that 'astronomer chases hacker on Berkely computer
systes'- novel, Cliff Stoll: The Cookoo's Egg? If not, try wikipedia. As an 
aside, I was told that at some universities' CS-classes, it is required 
lecture. In that novel, user's departments where charged according to resources 
spent on the university's computers and the main figure was tasked to find out 
about a 0.75$ accounting error and found a hacker instead. The system in the 
novel was a Berkeley Unix. So, systems that do what you want (and customers who 
want to pay on a per use basis) must be around for quite some time.  The novel 
is copyrighted 1989, I cannot track when the real event circling around a 
certain Markus Hess, cf. also wikipedia, took place. My guess about the system 
is  4.3BSD Tahoe or earlier 4.3BSD.

Cheers,
-- 
Christopher J. Ruwe
TZ GMT + 2
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Turning system accounting data into money

2011-10-11 Thread Polytropon
On Tue, 11 Oct 2011 23:14:44 +0300, Nikos Vassiliadis wrote:
> Yes, the builtin accounting facilities do most of the stuff you
> are interested in. Just add 'accounting_enable="YES"' in your
> /etc/rc.conf, run '/etc/rc.d/accounting start' and use sa to
> examine the output. I believe the per-user accounting will fit
> the bill nicely. You did not mention jails, right?

Not at the moment. If required, I'd have to do that
within the particular jail (and hope values are still
correct).



> The networking part perhaps can be a firewall's job, though
> I don't know if the per-user IP traffic rules work properly.
> There were some problems regarding this ages ago...

Per-user can be assumed as per-known-IP, as most
users will "call" from the same IP (or at least
IP range).

A different approach could be to give specific
connection ports to the customers individually,
so instead of :22 for SSH, :22001 for customer 1,
:22002 for customer2 and so on, so this could be
accounted by traffic "accumulation" based on port.



> The builtin printing stuff I believe is for use with the
> ancient printing tools [...]

The _standard_ printing tools. :-)



> [...] and I know nothing about CUPS...

I won't let _that_ on my application server. So for the
rare printing jobs, I think I may be better of with manually
counting the pages.



> Hey, these are pretty old stuff you are looking for or perhaps
> this email was stuck in the mail server's queue for 25 years;)

Think more broader, and think again, and you'll find many
"old-fashioned" things that became "modern" again. The
accounting model from mainframe times: "the Cloud",
"rent a software", "rent infrastructures", "guided dialogs"
and so on -- nothing new per se. It's just that some
customers re-"explore" those things and the payment models
related to them. And as it's my only wish to please the
good customer... well, he's the king, and I... I'm just,
erm... Help! Help! I'm being oppressed!!! :-)




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Turning system accounting data into money

2011-10-11 Thread Nikos Vassiliadis

On 10/11/2011 5:06 PM, Polytropon wrote:

This is _not_ a spam message trying to sell something
stupid to the list. I'm just searching for a solution
to turn consumed computing resources into a number and
a currency symbol. :-)

Reason: A growing amount of (my) customers seems to
like this concept: They speed a low fee for access to
systems and applications, and they want to pay according
to what they did with that system. The access fee covers
access and some basic services (backup&  quota), and for
anything "more advanced" they want to be charged per
"units" used, or per "consumed resources". This can be dialog
time (SSH), disk I/O, disk occupied, pages printed (can happen)
or pages required to print on exceptional specific forms
(can happen once or twice a year and is charged with an
additional fee for fold, staple&  mutilate).

Sounds stupid? I have _real_ customers intendedly
requesting that payment model (instead of "just pay
amount n Euro a month and do whatever you like").

Accidentally, I remembered history.

So I thought: This funcitonality has been present on
UNIX systems for many decades. But _how_ to use it? I
know there's the command set for accounting, for example
the "ac" command. But what does its output "total 7264.15"
mean? There also are "acct" (process accounting), "sa"
(for system accounting) and "pac" (for printer accounting,
just dooesn't seem to work with CUPS).

I'd also like to use the /etc/csh.logout resp. ~/.logout
mechanism. When a user logs in, he will be presented the
program he uses (or a menu, in case he uses different ones).
This can also be a regular "remote desktop" session. When
he logs out, a message should be displayed that informs
him how much will be charged for the session. At the end
of the month, he should get an invoice with the proper
accumulated amount.

For example, if a user wishes to issue a "make a backup
_now_, because I intendedly want _this_ current state
backed up _now_", this will be seen as additional I/O
load and disk occupation (because it's handled aside of
the regular backup runs that should be part of the
"basic package" charged with the "conneciton fee").
Or as I said, he issues printing for stuff he cannot
print at home, so he will be charged for 500 pages.
And in case he transfers 10 GB data in, and 10 GB data
out, he will be charged for that traffic, as well as
for the I/O.

The sessions in questions will be SSH sessions (text mode)
as well as SSH/X sessions (remote desktops).

Maybe someone already uses something similar he wants
to share? Suggestions and inspirations are welcome.






Yes, the builtin accounting facilities do most of the stuff you
are interested in. Just add 'accounting_enable="YES"' in your
/etc/rc.conf, run '/etc/rc.d/accounting start' and use sa to
examine the output. I believe the per-user accounting will fit
the bill nicely. You did not mention jails, right?

The networking part perhaps can be a firewall's job, though
I don't know if the per-user IP traffic rules work properly.
There were some problems regarding this ages ago...

The builtin printing stuff I believe is for use with the
ancient printing tools and I know nothing about CUPS...

Hey, these are pretty old stuff you are looking for or perhaps
this email was stuck in the mail server's queue for 25 years;)

HTH, Nikos
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Where to go for xorg information

2011-10-11 Thread Maciej Milewski
Dnia wtorek, 11 października 2011 11:52:15 d...@safeport.com pisze:
> Anyway my question: I imderstand that the FreeBSD Foundation is/was
> sponsoring coding for the Intel Ironlake chip. Does anyone know the status
> of this or perhaps where to inquire about the project status?
> _
> Douglas Denault

This should say something:
http://wiki.freebsd.org/Intel_GPU

Maciej

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: Linux 64bit compatability

2011-10-11 Thread Steven Friedrich
Sorry, thanks for informing me.  It's particularly frustrating since OSX IS
FreeBSD, under the hood.  WHEN will Apple show their gratitude?  I suspect
never.  It's a give and take relationship. The FreeBSD community gave and
Apple took.  They don't even create a FreeBSD version of iTunes.  A-holes.

Keep fighting, brother.


2011/10/11 Любомир Григоров 

> Yes, and unfortunately, there is a s...ton of software that is only
> Win/OSX/Linux, and a lot of it is 64bit. So unless FreeBSD's marketing team
> starts talking to all major corporations to ship native FreeBSD versions,
> emulation will be required. At this time there is no 64bit Linux emulation.
>
> I was told to ask here about the status of 64bit emulation. This list is as
> appropriate as it gets.
>
> 2011/10/11 Steven Friedrich 
>
>> FreeBSD is NOT linux.  Try a linux mailing list.
>>
>
>
> --
> Lyubomir Grigorov (bgalakazam)
>
>
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Printing

2011-10-11 Thread Jerry
I am using Cups 1.5.0 with FreeBSD-8.2/amd64. My printer is set up with
cups and print a test page perfectly.

The problem is if I go to print a document, say from my MUA or Firefox
and choose the printer from the pop-up menu, only a blank page is
ejected from the printer. Now, if I choose the "LPR" option the
document is printed normally. The printer is on a wireless network and
works fine from my Windows machines. On my FreeBSD machine, I have the
computer hooked up via cable to the router since there is no driver
available for the wireless card in the PC.

The Cups' log file indicates that everything printed perfectly, even
thought it obviously didn't.

I have no idea how to debug this problem. It just doesn't make any
sense.

-- 
Jerry ✌
jerry+f...@seibercom.net

Disclaimer: off-list followups get on-list replies or ignored.
Do not CC this poster. Please do not ignore the "Reply-To" header.

http://www.catb.org/~esr/faqs/smart-questions.html
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Where to go for xorg information

2011-10-11 Thread doug
If this is not the list, please point me to the correct one. Is there a list 
that corresponds to the XFree86 newbies list?


Anyway my question: I imderstand that the FreeBSD Foundation is/was sponsoring 
coding for the Intel Ironlake chip. Does anyone know the status of this or 
perhaps where to inquire about the project status?



_
Douglas Denault
http://www.safeport.com
d...@safeport.com
Voice: 301-217-9220
  Fax: 301-217-9277
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


comms/qpage port issue

2011-10-11 Thread Alton Pouncey
I am having a serious problem with the comms/qpage port.

I was running on an 8.2-RELEASE patch level 0 system:

 #uname -a
  FreeBSD dns.uasys.edu 8.2-RELEASE FreeBSD 8.2-RELEASE #0:
Fri Feb 18 02:24:46 UTC 2011

When I tried to send myself a page via qpage, I get a "Fatal error,
aborting" message to STDOUT and the following message gets put into
the /var/log/messages file:

  dns qpage[16399]: stack overflow detected; terminated
  dns kernel: pid 16399 (qpage), uid 66: exited on signal 6

I ran a truss on the qpage command (/usr/local/bin/qpage -dp arpouncey
"qpage test on 10/10/11")

and see that after a socket is created, nothing further happens, as if
it can't connect to the socket.

I applied the latest security patches to the system and am now running
at patch level 3:

  #uname -a
   FreeBSD dns.uasys.edu 8.2-RELEASE-p3 FreeBSD 8.2-RELEASE-p3
#0: Tue Sep 27 18:07:27 UTC 2011
r...@i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  i386

and I have removed the qpage package and reinstalled it via "make install clean"

However, when I run the same qpage command:

  #/usr/local/bin/qpage -dp arpouncey "qpage test on 10/11/11"

I still get:

  Fatal error, aborting
  >>> QUIT
  Fatal error, aborting

on STDOUT and these messages get written to the /var/log/messages file:

  dns qpage[17370]: stack overflow detected; terminated
  dns kernel: pid 17370 (qpage), uid 66: exited on signal 6

I don't know what to try from here.  Can anyone assist me?

Thank you,
Alton
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: can't find installed executables

2011-10-11 Thread Jerry McAllister
On Tue, Oct 11, 2011 at 11:09:40AM +0200, Jim jim wrote:

Jim,

First, just a politeness thing; please break your lines at about 72
character length.   It helps in reading and responding to your
questions.   Most Email clients allow you to set a line length.

> 
> Hallo,
> I'm kind of new to FreeBSD and installed the latest version a few days ago, 
> it gave me the option to install some packages and I chose some of them like 
> 'FlightGear' for example.But now I don't know how to execute this game or any 
> other program I got installed. I can find the folder and it's like 
> /usr/ports/games/flightgear but there is the Makefile so I think that is the 
> installation folder and i also tried to install it but than it shows me that 
> it is already installed.Could you tell me which one is the executable and how 
> to run it or where I can find it?
> Hope you can help me with this.

Besides the comments that some others have made, you might want to
learn about which(1), although in the case of flightgear it might not
have helped much because the installed name is a bit hard to guess 
from the name of the port.   But, most binaries pretty much follow
the name of the port.

That 'rehash' is also important.   When you first start a csh or tcsh
shell, it sets up a known picture of where things it knows about live.  
If you add something, it will ot know about it until something happens
to cause it to remake its list.  The Rehash command will do that.  Run
it before running the which.

jerry


> Yours Sincerely
> Jim van Dooren. 
> ___
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"
> 
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: User tasks in ~/.logout

2011-10-11 Thread Polytropon
On Tue, 11 Oct 2011 10:27:13 -0400 (EDT), Daniel Feenberg wrote:
> 
> 
> On Tue, 11 Oct 2011, Polytropon wrote:
> 
> > I have some users who I want to "schedule" a specific job
> > for which gets executed on their user account. For some
> > of them, it will be twice a day, for others just once a
> > month. It should happen at logout time.
> >
> > The intended mechanism to do so is ~/.logout, the C shell's
> > logout script.
> >
> 
> If the user doesn't want to wait for the script to complete for the
> session to end, you could start the script with a call to "batch" or "at".

Ah thanks, good idea! And concluded: Why not use detach?
It's a program that allows to run programs "detached" from
a controlling terminal - the thing that disappears at logout
time. :-)

Oh, and even the OS brings such a tool - "daemon", just found
its manpage.

I will compare both and see. Thanks, your inspiration seems
to do the trick.

Still, completition time should be minimal (less than 10 seconds
I think), so it wouldn't be _that_ complicated. The only thing
is to educate users to _properly_ close the connection so
I don't end up with "stale connections", e. g. in "top" or "w"
output, login shells running with nobody at the other end.



> The shell documentation claims that .logout executes whenever the shell
> exits, so your script should execute even if the user neglects to properly 
> log out, however I haven't experimented with that.

Maybe it's also good to make a timeout setting for that
shell, e. g. inactivity for 30 minutes causes connection
to be closed properly, including a "valid" shell exit.

Situations like "the shell never exists" or "the shell exits
accidentally when the user logs in for the next time" would
be unpleasant.



> Are you sure you wouldn't be better off with a cron job? Is it that you 
> don't want the script running while the user is logged in?

Yes, this is _one_ aspect. The other one is to create
things like backup sets depending on user interactivity.
For those who do two sessions per day, have two backup
files per day. For those only doing one session per
month, only this backup set will be used. This means
that every "session state" (last one, the one of yesterday,
the one of last month) can be restored.

Typical scenario... okay, I don't know if it's typical,
but a good example: User logs in, enters data. Fine.
Logs in later again, deletes data. Night comes, backup
runs. Next day: "I need my data of yesterday morning,
where is it?"



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: User tasks in ~/.logout

2011-10-11 Thread Daniel Feenberg



On Tue, 11 Oct 2011, Polytropon wrote:


I have some users who I want to "schedule" a specific job
for which gets executed on their user account. For some
of them, it will be twice a day, for others just once a
month. It should happen at logout time.

The intended mechanism to do so is ~/.logout, the C shell's
logout script.



If the user doesn't want to wait for the script to complete for the
session to end, you could start the script with a call to "batch" or "at".

The shell documentation claims that .logout executes whenever the shell
exits, so your script should execute even if the user neglects to properly 
log out, however I haven't experimented with that.


Are you sure you wouldn't be better off with a cron job? Is it that you 
don't want the script running while the user is logged in?


Dan Feenberg
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: User tasks in ~/.logout

2011-10-11 Thread Damien Fleuriot
On 10/11/11 3:57 PM, Polytropon wrote:
> I have some users who I want to "schedule" a specific job
> for which gets executed on their user account. For some
> of them, it will be twice a day, for others just once a
> month. It should happen at logout time.
> 
> The intended mechanism to do so is ~/.logout, the C shell's
> logout script.
> 
> Example: The user quits his work (shell "exit" or ending
> a custom program that is executed by the shell),
> now the ~/.logout shoult be executed, e. g. copying his
> current datasets to "immediate backup" (or other means of
> processing).
> 
> I assume I cannot use this approach when the user runs
> his specific program _as_ the shell (per /etc/passwd),
> but that's not a problem now, as it's easier to give
> a regular shell and use ~/.login to "auto-exec" the
> user-specific program).
> 
> My question is: As users connect to the system per SSH,
> how much time will the "at logout time" process have to
> finish work, or does it work _any_ time after the user
> has (1st) logged out and (2nd) terminated SSH connection
> (e. g. disconnect from SSH CLI client or PuTTY)?
> 
> Will such a ~/.logout job finish even if the user closes
> his connection right after logout?
> 
> And just in case a user does not properly log out (e. g.
> closes PuTTY right from the open session, maybe from within
> the program or shell he currently runs), will this cause
> ~/.logout to be processed, or will it be a "stale connection"?
> 
> 


I would suggest creating a dummy script that simply echoes the date to a
file.

Test your different scenarios, see if your file was written to correctly.

If that works, insert a delay in your script, for example sleep 20.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Turning system accounting data into money

2011-10-11 Thread Polytropon
This is _not_ a spam message trying to sell something
stupid to the list. I'm just searching for a solution
to turn consumed computing resources into a number and
a currency symbol. :-)

Reason: A growing amount of (my) customers seems to
like this concept: They speed a low fee for access to
systems and applications, and they want to pay according
to what they did with that system. The access fee covers
access and some basic services (backup & quota), and for
anything "more advanced" they want to be charged per
"units" used, or per "consumed resources". This can be dialog
time (SSH), disk I/O, disk occupied, pages printed (can happen)
or pages required to print on exceptional specific forms
(can happen once or twice a year and is charged with an
additional fee for fold, staple & mutilate).

Sounds stupid? I have _real_ customers intendedly
requesting that payment model (instead of "just pay
amount n Euro a month and do whatever you like").

Accidentally, I remembered history.

So I thought: This funcitonality has been present on
UNIX systems for many decades. But _how_ to use it? I
know there's the command set for accounting, for example
the "ac" command. But what does its output "total 7264.15"
mean? There also are "acct" (process accounting), "sa"
(for system accounting) and "pac" (for printer accounting,
just dooesn't seem to work with CUPS).

I'd also like to use the /etc/csh.logout resp. ~/.logout
mechanism. When a user logs in, he will be presented the
program he uses (or a menu, in case he uses different ones).
This can also be a regular "remote desktop" session. When
he logs out, a message should be displayed that informs
him how much will be charged for the session. At the end
of the month, he should get an invoice with the proper
accumulated amount.

For example, if a user wishes to issue a "make a backup
_now_, because I intendedly want _this_ current state
backed up _now_", this will be seen as additional I/O
load and disk occupation (because it's handled aside of
the regular backup runs that should be part of the
"basic package" charged with the "conneciton fee").
Or as I said, he issues printing for stuff he cannot
print at home, so he will be charged for 500 pages.
And in case he transfers 10 GB data in, and 10 GB data
out, he will be charged for that traffic, as well as
for the I/O.

The sessions in questions will be SSH sessions (text mode)
as well as SSH/X sessions (remote desktops).

Maybe someone already uses something similar he wants
to share? Suggestions and inspirations are welcome.




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


User tasks in ~/.logout

2011-10-11 Thread Polytropon
I have some users who I want to "schedule" a specific job
for which gets executed on their user account. For some
of them, it will be twice a day, for others just once a
month. It should happen at logout time.

The intended mechanism to do so is ~/.logout, the C shell's
logout script.

Example: The user quits his work (shell "exit" or ending
a custom program that is executed by the shell),
now the ~/.logout shoult be executed, e. g. copying his
current datasets to "immediate backup" (or other means of
processing).

I assume I cannot use this approach when the user runs
his specific program _as_ the shell (per /etc/passwd),
but that's not a problem now, as it's easier to give
a regular shell and use ~/.login to "auto-exec" the
user-specific program).

My question is: As users connect to the system per SSH,
how much time will the "at logout time" process have to
finish work, or does it work _any_ time after the user
has (1st) logged out and (2nd) terminated SSH connection
(e. g. disconnect from SSH CLI client or PuTTY)?

Will such a ~/.logout job finish even if the user closes
his connection right after logout?

And just in case a user does not properly log out (e. g.
closes PuTTY right from the open session, maybe from within
the program or shell he currently runs), will this cause
~/.logout to be processed, or will it be a "stale connection"?



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: can't find installed executables

2011-10-11 Thread Matthew Seaman
On 11/10/2011 10:09, Jim jim wrote:
> I'm kind of new to FreeBSD and installed the latest version a few
> days ago, it gave me the option to install some packages and I chose
> some of them like 'FlightGear' for example.But now I don't know how
> to execute this game or any other program I got installed. I can find
> the folder and it's like /usr/ports/games/flightgear but there is the
> Makefile so I think that is the installation folder and i also tried
> to install it but than it shows me that it is already installed.Could
> you tell me which one is the executable and how to run it or where I
> can find it?

We all had to begin somewhere.  As a general principle, if you don't
know how to do something, first check the handbook:

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/

Also, the usual regime of Googling and so forth.  If you're still
mystified, then feel free to ask here.

Now, for your specific question.  /usr/ports/games/flightgear is not the
location of the software you installed.  Rather it is a set of
instructions for how to download, build and install that particular
software.

FlightGear is a bit tricky in that the programs you need to run don't
have names anything like the package itself, as you might expect.  You
can tell this by looking at the file
/usr/ports/games/flightgear/pkg-plist which is a list of the files that
package installs.  Not all ports have a simple pkg-plist file like that,
so alternatively you could run:

pkg_info -lx flightgear | less

(most, but not all, portnames are lower-case)

Now, which of those to run?  This port installs some manual pages.  I'd
try reading fgfs(1) and fgjs(1) -- which means read the manual page for
fgfs from section 1 of the manual. ie type this:

man 1 fgfs

Well, '1' is the default actually, so you could miss that bit out and
still achieve the desired effect.  There can be occasions where you need
to specify it --- compare printf(1) with printf(3) for example.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
JID: matt...@infracaninophile.co.uk   Kent, CT11 9PW



signature.asc
Description: OpenPGP digital signature


Re: can't find installed executables

2011-10-11 Thread Bas Smeelen
On 10/11/2011 11:09 AM, Jim jim wrote:
> Hallo,
> I'm kind of new to FreeBSD and installed the latest version a few days ago, 
> it gave me the option to install some packages and I chose some of them like 
> 'FlightGear' for example.But now I don't know how to execute this game or any 
> other program I got installed. I can find the folder and it's like 
> /usr/ports/games/flightgear but there is the Makefile so I think that is the 
> installation folder and i also tried to install it but than it shows me that 
> it is already installed.Could you tell me which one is the executable and how 
> to run it or where I can find it?
> Hope you can help me with this.
> Yours Sincerely
> Jim van Dooren. 
Hi Jim,

Ports (and packages) are installed under /usr/local
For Flightgear for example in de ports directory you mention
/usr/ports/games/flightgear there is a file pkg-plist which contains a list
of files that are installed by this port. If you have done a rehash after
installing then the binary should be found in your path.
Good luck.


This e-mail is for the intended recipient(s) only. Access, disclosure, copying,
distribution or reliance on any of it by anyone else is prohibited. If you have 
received it
by mistake please let us know by reply and then delete it from your system.

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: can't find installed executables

2011-10-11 Thread Rares Aioanei
On Tue, 11 Oct 2011 11:09:40 +0200
Jim jim  wrote:

> 
> Hallo,
> I'm kind of new to FreeBSD and installed the latest version a few days ago, 
> it gave me the option to install some packages and I chose some of them like 
> 'FlightGear' for example.But now I don't know how to execute this game or any 
> other program I got installed. I can find the folder and it's like 
> /usr/ports/games/flightgear but there is the Makefile so I think that is the 
> installation folder and i also tried to install it but than it shows me that 
> it is already installed.Could you tell me which one is the executable and how 
> to run it or where I can find it?
> Hope you can help me with this.
> Yours Sincerely
> Jim van Dooren. 

Try 'rehash' from the terminal. (T)csh users need that.

-- 
Rares Aioanei
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


can't find installed executables

2011-10-11 Thread Jim jim

Hallo,
I'm kind of new to FreeBSD and installed the latest version a few days ago, it 
gave me the option to install some packages and I chose some of them like 
'FlightGear' for example.But now I don't know how to execute this game or any 
other program I got installed. I can find the folder and it's like 
/usr/ports/games/flightgear but there is the Makefile so I think that is the 
installation folder and i also tried to install it but than it shows me that it 
is already installed.Could you tell me which one is the executable and how to 
run it or where I can find it?
Hope you can help me with this.
Yours Sincerely
Jim van Dooren.   
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


Re: using /sbin/gpart to add GPT volume

2011-10-11 Thread Thomas Mueller
I don't think you can use gpart on a slice of an MBR-partitioned disk.

You can run "man gpart" if you didn't already; I didn't see anything to migrate 
an MBR partition table to GPT.

The older gpt, which NetBSD still uses, can migrate an MBR partition table to 
GPT.

You could try Roderick Smith's gdisk

http://www.rodsbooks.com/gdisk/

which is found, among other places, on the System Rescue CD

http://sysrescccd.org/

also in sysutils/gdisk in FreeBSD ports tree.

Rod Smith's gdisk can make a wider variety of partition types than gpt or gpart,
and can also migrate an MBR partition table to GPT.


Tom

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"