Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Postal
Aug 9, 2003

Don't make me go postal!

Ashex posted:

gksu/gksudo

What distro are you using? Those don't seem to be well supported in Fedora 9. And the consolehelper solution isn't working well either.

Adbot
ADBOT LOVES YOU

Ashex
Jun 25, 2007

These pipes are cleeeean!!!

Postal posted:

What distro are you using? Those don't seem to be well supported in Fedora 9. And the consolehelper solution isn't working well either.

I'm running Kubuntu. gksu is actually libgsku, so if you load that, you should then have that command.

Twlight
Feb 18, 2005

I brag about getting free drinks from my boss to make myself feel superior
Fun Shoe
I have a couple hundred users that connect to our ERP solution that runs RHEL 3. Before I got here when a user left the company there user account was never removed from the system. Now I have a huge homes directory that has both inactive and active accounts.

What would be a decent way to do the following?

1: get a list emailed each month with users that have been inactive for x amount of days

2: automatically disable accounts inactive between x and y

3: remove accounts that are inactive past y

Ashex
Jun 25, 2007

These pipes are cleeeean!!!

Twlight posted:

I have a couple hundred users that connect to our ERP solution that runs RHEL 3. Before I got here when a user left the company there user account was never removed from the system. Now I have a huge homes directory that has both inactive and active accounts.

What would be a decent way to do the following?

1: get a list emailed each month with users that have been inactive for x amount of days

2: automatically disable accounts inactive between x and y

3: remove accounts that are inactive past y

I would have a list generated of users that haven't logged in within the past 90 days, then automatically disable them.

Ideally, before it goes through the disable part, delete users who haven't logged in within the past 6 months, but only disabled accounts. This avoids removing users who may be on sick/vacation/maternity leave.

Then just have it email the results of the check after it has run.

Edit: Although, that would still get users who are on extended-leave since it does auto-disable. Possibly have a "standby" group to add these users to.

Ashex fucked around with this message at 19:01 on Aug 29, 2008

Twlight
Feb 18, 2005

I brag about getting free drinks from my boss to make myself feel superior
Fun Shoe

Ashex posted:

I would have a list generated of users that haven't logged in within the past 90 days, then automatically disable them.

Ideally, before it goes through the disable part, delete users who haven't logged in within the past 6 months, but only disabled accounts. This avoids removing users who may be on sick/vacation/maternity leave.

Then just have it email the results of the check after it has run.

Edit: Although, that would still get users who are on extended-leave since it does auto-disable. Possibly have a "standby" group to add these users to.

Yea I just ran into this problem we had a manager that was gone for 2 months on medical, now hes leaving again for another 2 months so I can see where a holding group would make sense.

how would it be best to get logged in information? just ls -al the home directories?

Ashex
Jun 25, 2007

These pipes are cleeeean!!!

Twlight posted:

Yea I just ran into this problem we had a manager that was gone for 2 months on medical, now hes leaving again for another 2 months so I can see where a holding group would make sense.

how would it be best to get logged in information? just ls -al the home directories?

I would suggest using last


Edit: actually, that won't work since cleanup will remove that once a week. I suggest looking at this script.

Here's an example:

Example: To get a list of all real users who haven't logged in in at least a
year:

lastlogin -onb -a -u'(t-b) > 86400*365'


source

Ashex fucked around with this message at 20:27 on Aug 29, 2008

Twlight
Feb 18, 2005

I brag about getting free drinks from my boss to make myself feel superior
Fun Shoe

Ashex posted:

I would suggest using last


Edit: actually, that won't work since cleanup will remove that once a week. I suggest looking at this script.

Here's an example:

Example: To get a list of all real users who haven't logged in in at least a
year:

lastlogin -onb -a -u'(t-b) > 86400*365'


source

These systems are not well maintained, cleanup isn't running so last worked out perfectly. To script this up, I'm assuming i would use awk to grab dates that i would like?

JoeNotCharles
Mar 3, 2005

Yet beyond each tree there are only more trees.

Twlight posted:

These systems are not well maintained, cleanup isn't running so last worked out perfectly. To script this up, I'm assuming i would use awk to grab dates that i would like?

Depending on cleanup not running seems like a bad thing - if someone took over and started maintaining the system better, things would start breaking.

EDIT: do you have an easy way to get a list of each employee's manager? (I assume they have one.) I'd have it email their manager when their account is about to be deleted, so that a human gets a chance to intervene. ("If this employee is still with the company and is just on extended leave, please contact IT immediately.")

derdewey
Dec 3, 2004
Ext3 formatted harddrive installed in my Ubuntu 8.04 server went to crap. I just want to make 100% it's a hardware problem before I RMA it.

Yesterday:
So I removed it from fstab, and can do clean restarted. When I mount it I can see all the folders. I was actually able to copy out 60gb of 420~ gb but the other folders only show up as 4kb when I use "du -hsc *". And when I hop into those folders I then start to see "I/O error" type problems.

Today:
I tried just running fsck on /dev/sdc1 when it was unmounted and it spits out a can't read error. So now it's 100% dead? I shouldn't bother reformatting?

dont skimp on the shrimp
Apr 23, 2008

:coffee:

derdewey posted:

Ext3 formatted harddrive installed in my Ubuntu 8.04 server went to crap. I just want to make 100% it's a hardware problem before I RMA it.

Yesterday:
So I removed it from fstab, and can do clean restarted. When I mount it I can see all the folders. I was actually able to copy out 60gb of 420~ gb but the other folders only show up as 4kb when I use "du -hsc *". And when I hop into those folders I then start to see "I/O error" type problems.

Today:
I tried just running fsck on /dev/sdc1 when it was unmounted and it spits out a can't read error. So now it's 100% dead? I shouldn't bother reformatting?
What chipset are you running it on? I used to get random I/O-errors and hosed harddrives on my old VIA chipset. Got a PCI-IDE card to handle the drives, that fixed it for me.

Ashex
Jun 25, 2007

These pipes are cleeeean!!!

derdewey posted:

Ext3 formatted harddrive installed in my Ubuntu 8.04 server went to crap. I just want to make 100% it's a hardware problem before I RMA it.

Yesterday:
So I removed it from fstab, and can do clean restarted. When I mount it I can see all the folders. I was actually able to copy out 60gb of 420~ gb but the other folders only show up as 4kb when I use "du -hsc *". And when I hop into those folders I then start to see "I/O error" type problems.

Today:
I tried just running fsck on /dev/sdc1 when it was unmounted and it spits out a can't read error. So now it's 100% dead? I shouldn't bother reformatting?

What was the error? I use fsck to test drives at work to determine failure, I can usually spot a hardware error over a partition error.

derdewey
Dec 3, 2004

Ashex posted:

What was the error? I use fsck to test drives at work to determine failure, I can usually spot a hardware error over a partition error.

code:
root@lianli:/dev# fsck -pcfv /dev/sdc1 
fsck 1.40.2 (12-Jul-2007)
/dev/sdc1: recovering journal
Error reading block 1055 (Attempt to read block from filesystem resulted in short read) while reading inode and block bitmaps.  

/dev/sdc1: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
        (i.e., without -a or -p options)
code:
root@lianli:/dev# fsck -cfv /dev/sdc1 
fsck 1.40.2 (12-Jul-2007)
e2fsck 1.40.2 (12-Jul-2007)
fsck.ext2: Attempt to read block from filesystem resulted in short read while trying to open /dev/sdc1
Could this be a zero-length partition?

Ashex
Jun 25, 2007

These pipes are cleeeean!!!

derdewey posted:

code:
root@lianli:/dev# fsck -pcfv /dev/sdc1 
fsck 1.40.2 (12-Jul-2007)
/dev/sdc1: recovering journal
Error reading block 1055 (Attempt to read block from filesystem resulted in short read) while reading inode and block bitmaps.  

/dev/sdc1: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
        (i.e., without -a or -p options)
code:
root@lianli:/dev# fsck -cfv /dev/sdc1 
fsck 1.40.2 (12-Jul-2007)
e2fsck 1.40.2 (12-Jul-2007)
fsck.ext2: Attempt to read block from filesystem resulted in short read while trying to open /dev/sdc1
Could this be a zero-length partition?

yeah, generally an error dealing with a short read means a drive failure. You can try a complete whipe, but chances are it'll fail again soon.

Greed is eternal
Jun 8, 2008

Twlight posted:

I have a couple hundred users that connect to our ERP solution that runs RHEL 3. Before I got here when a user left the company there user account was never removed from the system. Now I have a huge homes directory that has both inactive and active accounts.

What would be a decent way to do the following?

1: get a list emailed each month with users that have been inactive for x amount of days

2: automatically disable accounts inactive between x and y

3: remove accounts that are inactive past y

I don't know how the finger(1) command access the data, maybe it uses /var/log/wtmp too. Maybe somebody can fill us in on that. However, I believe the output is eeasier to parse if you are going to make a script.

Peanutmonger
Dec 6, 2002

derdewey posted:

Today:
I tried just running fsck on /dev/sdc1 when it was unmounted and it spits out a can't read error. So now it's 100% dead? I shouldn't bother reformatting?

You could also try installing smartmontools and use smartctl to view the error log on the drive and run tests. That usually removes any doubt.

Twlight
Feb 18, 2005

I brag about getting free drinks from my boss to make myself feel superior
Fun Shoe

JoeNotCharles posted:

Depending on cleanup not running seems like a bad thing - if someone took over and started maintaining the system better, things would start breaking.

EDIT: do you have an easy way to get a list of each employee's manager? (I assume they have one.) I'd have it email their manager when their account is about to be deleted, so that a human gets a chance to intervene. ("If this employee is still with the company and is just on extended leave, please contact IT immediately.")

I should have been more clear, I've started to document (because there is 0 documentation about anything) and automate how things are done. This IT department is a loving mess beyond belief, but it does give me the change to learn which has been invaluable. I'm writing scripts and using CFengine to push out changes which is a step in the right direction, we just have so many little things like automating user administration (or at least doing it a single way) that should have already been done.

vanjalolz
Oct 31, 2006

Ha Ha Ha HaHa Ha
Is there a simple, short, easy to follow tutorial on setting up *any* mail system on my home server. I just need it to send me status updates every other day - preferably to my @gmail.com, but I don't mind if it is just a system mail address.

I notice a lot of services use mail to provide status updates, but my distro just doesn't have it set up.

I have apt-get, but I'm not on debian. I've apt-getted sendmail and postfix (separately) and neither was set up to go.

Chuu
Sep 11, 2004

Grimey Drawer
I'm currently trying to compile Sage on a Duron 1000. Is it normal for this to take more than 12 hours?

Lucien
May 2, 2007

check it out i'm a samurai ^_^

vanjalolz posted:

Is there a simple, short, easy to follow tutorial on setting up *any* mail system on my home server. I just need it to send me status updates every other day - preferably to my @gmail.com, but I don't mind if it is just a system mail address.

I notice a lot of services use mail to provide status updates, but my distro just doesn't have it set up.

I have apt-get, but I'm not on debian. I've apt-getted sendmail and postfix (separately) and neither was set up to go.
What distro are you running? With Ubuntu I just installed ssmtp and it works great. My server is now sending me e-mails with their gmail account.

vanjalolz
Oct 31, 2006

Ha Ha Ha HaHa Ha
Nexenta GNU/Solaris, tried to apt-get ssmtp with no luck :/

Scaevolus
Apr 16, 2007

Chuu posted:

I'm currently trying to compile Sage on a Duron 1000. Is it normal for this to take more than 12 hours?

Sage includes so many complex libraries that I wouldn't be surprised if it took that long.

What's wrong with the binary versions?

Eyecannon
Mar 13, 2003

you are what you excrete

vanjalolz posted:

Nexenta GNU/Solaris, tried to apt-get ssmtp with no luck :/

apt-get install postfix

Then you have to edit the config files in /etc/postfix, master.cf and main.cf. Everything is well commented.

Chuu
Sep 11, 2004

Grimey Drawer

Scaevolus posted:

Sage includes so many complex libraries that I wouldn't be surprised if it took that long.

What's wrong with the binary versions?

I heard sage does profiling for algorithm selection on compilation, and considering the machine I was running it on I thought it would probably be wise not to use the default profiles.

It took a bit under 24 hours btw.

maskenfreiheit
Dec 30, 2004
...

maskenfreiheit fucked around with this message at 21:49 on Nov 28, 2013

JoeNotCharles
Mar 3, 2005

Yet beyond each tree there are only more trees.

GregNorc posted:

Edit: Never mind, discovered the problem on my own.

Well, tell us what it was so we can learn something!

ShoulderDaemon
Oct 9, 2003
support goon fund
Taco Defender

JoeNotCharles posted:

Well, tell us what it was so we can learn something!

I'd assume the problem was that he was providing a full path to the file, so his FTP client was trying to preserve the path on the remote end as well, but the remote machine didn't have a /Users/gregnorc/desktop directory so it just failed with a terrible error message.

Roctor
Aug 23, 2005

The doctor of rock.
So I was adding a hard drive for the first time ever on my Ubuntu box. I was using fdisk to partition and for some reason or another I was having problems. fdisk would claim that the hard drive was in use and it would use the new partition table upon rebooting.

So, after one of these attempts to correctly partition/format my drive I rebooted and got a grub error: error 22. After looking up this error, I think I may have typed fdisk /dev/sda instead of fdisk /dev/sdb and then proceeded to delete the primary partition.

Presumably the data is still in tact, but I'm not sure how to go about fixing this situation. I'm currently downloading a ubuntu live cd to hopefully get access to the drive to see what's going on.

My question is, if indeed I managed to delete my primary partition on my primary drive, how hosed am I?

x1o
Aug 5, 2005

My focus is UNPARALLELED!

Roctor posted:

My question is, if indeed I managed to delete my primary partition on my primary drive, how hosed am I?

If you can remember exactly how your partitions were setup, then you are in luck. All you have to do is recreate them, reboot and you should be fine. If not, there are some tools out there that can reconstruct partition tables, but I didn't have much luck with them.

Mr. Eric Praline
Aug 13, 2004
I didn't like the others, they were all too flat.

ShoulderDaemon posted:

I'd assume the problem was that he was providing a full path to the file, so his FTP client was trying to preserve the path on the remote end as well, but the remote machine didn't have a /Users/gregnorc/desktop directory so it just failed with a terrible error message.
Correct. More specifically, the FTP server wasn't expanding the tilde (~), which is a shell built-in, not an actual filesystem call.

Saukkis
May 16, 2003

Unless I'm on the inside curve pointing straight at oncoming traffic the high beams stay on and I laugh at your puny protest flashes.
I am Most Important Man. Most Important Man in the World.

Roctor posted:

Presumably the data is still in tact, but I'm not sure how to go about fixing this situation. I'm currently downloading a ubuntu live cd to hopefully get access to the drive to see what's going on.

My question is, if indeed I managed to delete my primary partition on my primary drive, how hosed am I?
You could try TestDisk, it may be able to restore the partitions. But first read the SH/SC Wiki Data Recovery article.

Super-NintendoUser
Jan 16, 2004

COWABUNGERDER COMPADRES
Soiled Meat
Just a quick, teeny question: I want to setup a linux based home server to store music and movies on. I figure I'll just have it run as a file server to my windows PCs. I don't need anything else, really, no permissions or anything. Just a bunch of files available on shared folders for my LAN.

I'm familiar with Linux, I work a lot on CentOS and Ubuntu, but I just wanted to know what'd be the best flavor to use, and then what packages I should use for file sharing.

Megaman
May 8, 2004
I didn't read the thread BUT...
Ubuntu + samba or Ubuntu + sftp to get linux files to windows, SSH for linux to linux from anywhere.

Super-NintendoUser
Jan 16, 2004

COWABUNGERDER COMPADRES
Soiled Meat

Megaman posted:

Ubuntu + samba or Ubuntu + sftp to get linux files to windows, SSH for linux to linux from anywhere.

I figured it'd be simple like that. I didn't know if I needed some special file sharing package to share media. I can get a Ubuntu box with Samba configured easily enough.

Megaman
May 8, 2004
I didn't read the thread BUT...

Ericcorp posted:

I figured it'd be simple like that. I didn't know if I needed some special file sharing package to share media. I can get a Ubuntu box with Samba configured easily enough.

I'm assuming samba has built in encryption since it's coming from a GNU/Linux system, but can anyone confirm how that works? Else use sftp which is spawned automatically when connecting to the GNU/Linux box.

Roctor
Aug 23, 2005

The doctor of rock.
I don't remember the commands off the top of my head, but you create samba users. You can adjust what shared folders each user has access to. Then when you try to access the folder from windows you enter the desired samba username/pw.

Ashex
Jun 25, 2007

These pipes are cleeeean!!!

Ericcorp posted:

Just a quick, teeny question: I want to setup a linux based home server to store music and movies on. I figure I'll just have it run as a file server to my windows PCs. I don't need anything else, really, no permissions or anything. Just a bunch of files available on shared folders for my LAN.


like was mentioned above, samba will do what you want. I also recommend setting up a daap server if you are going to do music.

I have a file server setup exactly as you describe, for samba, these are the relevant chunks:


code:

security = share
guest account = nobody

[Share]

path = /home/Share
public = yes
guest ok = yes
guest only = yes
guest account = nobody
browseable = yes
I defined the guest account twice since at one point I had issues with that part.


edit, for samba security, you create a user on the box, then do smbpasswd -a user, it will prompt for a password, and that will add them to samba. set security to user and it will prompt for their credentials. restart samba service after you add a user though.

Ashex fucked around with this message at 01:51 on Sep 4, 2008

covener
Jan 10, 2004

You know, for kids!

Megaman posted:

I'm assuming samba has built in encryption since it's coming from a GNU/Linux system, but can anyone confirm how that works?

Not a reasonable assumption.

Lord Dudeguy
Sep 17, 2006
[Insert good English here]
Is symbolic linking a legitimate practice to use heavily?

Situation: My company runs an Intranet document repository (Docman for Joomla 1.0.3) that maintains all public and frequently updated reports. Docman's world lives in:

code:
/usr/local/apache/docman/
... with subdirectories based on department. Each subdirectory runs its own secure SAMBA share, with write permissions given out to only the users that need them, and everyone else gets read-only permissions.

The problem here is that our web devs have hosed with Docman so much that it now no longer recognizes subdirectories. That means that it only sees DOCUMENTS in the /apache/docman directory, and nothing in /apache/docman/xxxxx.

I brought this up to the webdev, who told me that "This isn't a priority" and then continued editing color schemes in VIM.

Solution: So, I headed back and realized that I had two options.

- Create a global SAMBA share to the /apache/docman directory, enabling all users to gently caress with whatever they wanted.

-OR-

- Create a symbolic link from the root directory to the desired document, each time somebody asks for their "missing form" to come back.

I've done this (the latter) only once so far. Everyone seems to be pleased with the resolution, and the webdev has been royally chewed out for it... then promptly ignored. Now he refuses to fix the bug out of spite for me, the "lowly mechanic" who found a way to simply get poo poo working again.

I can't help but feel that this is a chewing-gum-on-the-pipe type of fix. The code's broken, and it needs fixing. Unfortunately I have no knowledge or wherewithal of his code, or the original component, or even loving with Joomla/Mambo beyond setup, configuration, and launch. This is all I could come up with as a feasible, secure (and somewhat invisible) solution.

Is using symbolic links habitually a good practice? If not, would using it in this case be an exception? I doubt that there's enough demand on these documents to create some creepily absurd CPU overhead, with links going this way and that, and it does seem to be the most secure method, shy of FIXING THE MOTHERFUCKING CODE.

Thoughts?

Lord Dudeguy fucked around with this message at 11:13 on Sep 4, 2008

Megaman
May 8, 2004
I didn't read the thread BUT...

covener posted:

Not a reasonable assumption.

My mistake then, what would be the best encryption solution from linux to windows? sftp?

Adbot
ADBOT LOVES YOU

Lucien
May 2, 2007

check it out i'm a samurai ^_^

Steppo posted:

Is using symbolic links habitually a good practice? If not, would using it in this case be an exception? I doubt that there's enough demand on these documents to create some creepily absurd CPU overhead, with links going this way and that, and it does seem to be the most secure method, shy of FIXING THE MOTHERFUCKING CODE.
Thoughts?
How about creating a global user based samba share where user permissions should still hold?

That said, there's nothing wrong with symbolic linking where it makes sense (it doesn't so much here but you know that).

Megaman posted:

My mistake then, what would be the best encryption solution from linux to windows? sftp?
Yes.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply