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
Sir Sidney Poitier
Aug 14, 2006

My favourite actor


They were just (bad) examples. Most commands I want to run are not changing files like that.

Edit: I found my answer: clusterit. The only problem so far is that it doesn't appear to loop back. So I would need to run it from one of the nodes that isn't part of the cluster. Which is better than nothing, unless someone knows how to make it loop back?

Edit2: Just made a script to execute it locally, then on the cluster.

Sir Sidney Poitier fucked around with this message at 15:34 on Apr 19, 2011

Adbot
ADBOT LOVES YOU

Modern Pragmatist
Aug 20, 2008
The other day I noticed that the hard disk light on my computer is constantly on (doesn't blink). Is there a utility that allows me to monitor actual reads/writes to the disk so I can figure out if something is actually writing to it or the light is getting incorrect signals?

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

Modern Pragmatist posted:

The other day I noticed that the hard disk light on my computer is constantly on (doesn't blink). Is there a utility that allows me to monitor actual reads/writes to the disk so I can figure out if something is actually writing to it or the light is getting incorrect signals?

code:
$ iostat -d 1
Linux 2.6.18-194 	04/20/2011

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
sda              33.54       443.16       632.83 2912339880 4158795868
sda1              0.00         0.06         0.00     410104       1956
sda2              0.95         6.64        30.28   43630443  199014152
sda3              0.00         0.00         0.00       1393        272
sda4              0.00         0.00         0.00         10          0
sda5             32.59       436.46       602.55 2868297210 3959779488

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
sda               0.00         0.00         0.00          0          0
sda1              0.00         0.00         0.00          0          0
sda2              0.00         0.00         0.00          0          0
sda3              0.00         0.00         0.00          0          0
sda4              0.00         0.00         0.00          0          0
sda5              0.00         0.00         0.00          0          0

Modern Pragmatist
Aug 20, 2008

Bob Morales posted:

code:
iostat -d 1

Awesome. Thanks. Looks like it's just the light since there is no activity.

VVVV Well I'll be damned. That is quite useful. Thanks.

Modern Pragmatist fucked around with this message at 16:06 on Apr 20, 2011

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

While iostat is pretty good for determining how much IO is happening per device, iotop is better for isolating a particular process.

code:
$ iotop -o

Total DISK READ: 890.39 K/s | Total DISK WRITE: 2.78 M/s
  TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN     IO>    COMMAND
 5613 be/4 root      890.39 K/s    0.00 B/s  0.00 % 88.93 % rsync -a --delete --numeric-ids ...
22744 be/3 root        0.00 B/s    2.12 M/s  0.00 % 12.36 % [jbd2/dm-15-8]
 4557 be/4 root        0.00 B/s    0.00 B/s  0.00 %  0.03 % [kworker/u:0]

Casimirus
Mar 28, 2005
Yes.
I'm trying to automate a few things that I do regularly. I created a few scripts that work exactly as I'd expect them to: run a few things in sequence.

However, I've run into something that I can't seem to script. Normally, I run, from an interactive bash shell:
code:
setsid ./command arg1 arg2 > /dev/null
So I figured I could just shove that into a shell script and it would work. I want it to detatch from a non-interactive script (going to call this on system startup somewhere) instead of from an interactive shell, but that doesn't seem like a big difference. I created the following file and tried to run it:
code:
#!/bin/sh
setsid ./command arg1 arg2 > /dev/null
and it just hangs. So I created something that I'm more familiar with,
code:
#!/bin/sh
nohup ./command arg1 arg2 > /dev/null 2>&1
and that hangs as well.

How do I run something and have it detatch from a script?

TheGopher
Sep 7, 2009
Any reason you can't just run the script like: ./script.sh &

Casimirus
Mar 28, 2005
Yes.
Well, I intend to put other stuff below it at some point, so that would entail creating a shell script to wrap a single command, so an extra copy of the interpreter, plus multiple files is a lot less clean. I'd assume there's a correct way to do what I need to do.

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

Maybe I'm missing something here, but none of your examples had a & at the end of the line.

I made a quick test and stuff like "cat /dev/urandom > /dev/null &" runs in the background from a script. The examples I see for nohup also have the ampersand at the end.

Casimirus
Mar 28, 2005
Yes.
Well, "> /dev/null 2>&1" was something that I remembered using years ago when I used Linux daily, so I pasted it in. It turns out that ">&" is totally different from "&", so "> /dev/null 2>&1 &" works. I was assuming that "2>&1" not only redirected STDERR into STDOUT, but also detached it, when that wasn't the case.

ToxicFrog
Apr 26, 2008


There's actually three different things going on here - detachment, IO redirection, and backgrounding.

'&' is "run in background". The command is still "attached" to the terminal it was started from, but other commands can be started in the meantime. In an interactive session, at least, background jobs can be moved to the foreground with 'fg' (and back to the background again with ctrl-Z 'bg').

'&n' is "file descriptor n". '> /dev/null' is "redirect fd 1 (stdout) to /dev/null", and '2>&1' is "redirect fd 2 (stderr) to fd 1 (stdout)". There's no relation to the sole '&' used to run a program in the background.

Finally, 'nohup' detaches the program from the terminal so that it won't try to read from it or write to it and so that it won't get a NOHUP signal when the terminal closes.

Erasmus Darwin
Mar 6, 2001

ToxicFrog posted:

'&n' is "file descriptor n". '> /dev/null' is "redirect fd 1 (stdout) to /dev/null", and '2>&1' is "redirect fd 2 (stderr) to fd 1 (stdout)". There's no relation to the sole '&' used to run a program in the background.

Also the order matters.

If you do:
$ foo >/dev/null 2>&1
It sends both stdout and stderr to /dev/null.

If you do:
$ foo 2>&1 >/dev/null
It sends stderr to stdout and stdout to /dev/null.

That's because it works left-to-right, and '&n' equates to the current target of the specified descriptor.

Dilbert As FUCK
Sep 8, 2007

by Cowcaster
Pillbug
Is SElinux of any benefit to keep on? It is a real headache, this server is going to be for the whole company so I would like as much security as I can get, but this is just getting in my way constantly.

pram
Jun 10, 2001
If you run a web server yes. SElinux is not that difficult to learn and pretty easy to maintain once you get the hang of it.

If your server can't be accessed externally though then who cares. :chord:

Dilbert As FUCK
Sep 8, 2007

by Cowcaster
Pillbug

Pram posted:

If you run a web server yes. SElinux is not that difficult to learn and pretty easy to maintain once you get the hang of it.

If your server can't be accessed externally though then who cares. :chord:

know any good guides to learning it

pram
Jun 10, 2001
I reference these when I have to deal with it:

http://wiki.centos.org/HowTos/SELinux
http://www.centos.org/docs/5/html/5.1/Deployment_Guide/rhlcommon-chapter-0017.html

Dilbert As FUCK
Sep 8, 2007

by Cowcaster
Pillbug

Yeah I am just not going to use it, it seems to cause me a lot of headaches

bort
Mar 13, 2003

I like the Red Hat docs on it:
http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/selg-overview.html

Running a strict policy on an internal server is probably paranoid. But if it gets in your way, it'll get in the way of whoever you're worried about. If it's really a risk worth worrying about, you might want those kind of hurdles in the way. Targeted policies have pretty solid man pages for whatever service you're protecting (e.g. man httpd_selinux). What you're complaining about is why people reply "disable it" to questions like yours.

Dilbert As FUCK
Sep 8, 2007

by Cowcaster
Pillbug

bort posted:

I like the Red Hat docs on it:
http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/selg-overview.html

Running a strict policy on an internal server is probably paranoid. But if it gets in your way, it'll get in the way of whoever you're worried about. If it's really a risk worth worrying about, you might want those kind of hurdles in the way. Targeted policies have pretty solid man pages for whatever service you're protecting (e.g. man httpd_selinux). What you're complaining about is why people reply "disable it" to questions like yours.

Yeah I was thinking that, maybe once I start making 30k or more I will look at it

pram
Jun 10, 2001

Corvettefisher posted:

Yeah I was thinking that, maybe once I start making 30k or more I will look at it

Thats the spirit.

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.
I'd like to also point out that "disable it" won't be a good option on Red Hat platforms in the future now that Fedora is actually leveraging SELinux's capabilities model to provide RBAC instead of doing dumb things like making ping setuid root.

other people
Jun 27, 2004
Associate Christ
Does any one have any experience with btrfs?

I was reading this: https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices

and I would like to know if I can mix devices with partitions?

So I have created a btrfs file system with mkfs.btrfs /dev/sdb, can I then add /dev/sda4 , or something to that effect, without screwing up /dev/sda1,2,3, which are different file systems?

enotnert
Jun 10, 2005

Only women bleed
Quick question that hopefully someone has a direct answer to, since all my googlin has left me blank.

Is there any live/install linux distro that will boot an older model sparc processor, and mount drives left from a solaris install?

Long story short of why I have to do this is I might have to do some quick and fast and mean work tomorrow morning rooting a solaris 7 sun machine to get an old rear end scantron to work.

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

^^^ Maybe http://www.martux.org/ (Found with google search, never used it)
e: I'm pretty sure the Sparc gentoo livecd can do what you need.

Kaluza-Klein posted:

Does any one have any experience with btrfs?

I was reading this: https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices

and I would like to know if I can mix devices with partitions?

So I have created a btrfs file system with mkfs.btrfs /dev/sdb, can I then add /dev/sda4 , or something to that effect, without screwing up /dev/sda1,2,3, which are different file systems?

The device is the entire drive, including the partition table and all partitions. If you format the entire device, you will wipe out the partitions. Regardless of the filesystem.

taqueso fucked around with this message at 22:21 on Apr 25, 2011

TheGopher
Sep 7, 2009
Not sure what filesystem it needs to mount, but FreeBSD has a SPARC64 Live CD. If the machine is 32-bit SPARC that will be trickier. OpenBSD is only one of two *nix distributions that still has 32-bit SPARC support, and I can't remember the other: OpenBSD 4.8 here.

Dilbert As FUCK
Sep 8, 2007

by Cowcaster
Pillbug

Pram posted:

Thats the spirit.

I forced HTTPS logins, complex passwords, encrypted the databases and server, set up antispam, IDS, and virus scans on documents. I think that is okay for right now, prior to my doings we did have any of this.

Dilbert As FUCK fucked around with this message at 22:45 on Apr 25, 2011

enotnert
Jun 10, 2005

Only women bleed
poo poo, I have no clue why I didn't think of gentoo or a BSD. . .

Just a clue to how loopy my head is these days.

Longinus00
Dec 29, 2005
Ur-Quan

Kaluza-Klein posted:

Does any one have any experience with btrfs?

I was reading this: https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices

and I would like to know if I can mix devices with partitions?

So I have created a btrfs file system with mkfs.btrfs /dev/sdb, can I then add /dev/sda4 , or something to that effect, without screwing up /dev/sda1,2,3, which are different file systems?

You can but unless sdb and sda4 are the same size it might not work like you want it to.

other people
Jun 27, 2004
Associate Christ
I have two physical drives in my "pool" now. Ubuntu or Gnome or Nautilus is confused though. In my fstab I mount one drive in the pool, and btrfs magically finds and uses both drives, but I guess the desktop isn't aware of this. It sees the second drive and lists it as one of the "devices" (like removable storage) in nautilus.

Is there any way to stop this? I assume if I attach another bare drive to this pool, it too will appear here.

Am I making any sense?

Crackbone
May 23, 2003

Vlaada is my co-pilot.

Having a samba nightmare.

Running Fedora 14. What I'm hoping to do is setup a share with anonymous r/w access for some Win 7 and Xp/2003 machines which are on a AD domain. Furthest I can get is having the share visible but not accessible (attempting to access the share gives me the generic "not accessible" error). This happens on both machines.

Hoping to get a little bit of handholding on this - I've looked around and tried dozens of different variations in the smb.conf file, changing file permissions/owners but something is sailing over my head.

Can anybody post a basic config that should allow what I'm looking for? At this point I don't really care where the share is located, I just want to get something up and running. I've heard that Win 7 complicates things, so I'd even settle for getting access from the xp/2003 machines.

Crackbone fucked around with this message at 16:51 on Apr 26, 2011

Scarythought
Apr 26, 2011
Can you goto System->Administration->Disks and see if you can turn of auto-detect?

TheGopher
Sep 7, 2009

Crackbone posted:

Having a samba nightmare.

Running Fedora 14. What I'm hoping to do is setup a share with anonymous r/w access for some Win 7 and Xp/2003 machines which are on a AD domain. Furthest I can get is having the share visible but not accessible (attempting to access the share gives me the generic "not accessible" error). This happens on both machines.

Hoping to get a little bit of handholding on this - I've looked around and tried dozens of different variations in the smb.conf file, changing file permissions/owners but something is sailing over my head.

Can anybody post a basic config that should allow what I'm looking for? At this point I don't really care where the share is located, I just want to get something up and running. I've heard that Win 7 complicates things, so I'd even settle for getting access from the xp/2003 machines.

Not accessible is a permissions error. Check the logs for more info, and try using SWAT if you're having a lot of trouble. I can post my smb.conf once I'm at work, as that machine is running Fedora 13 and hosts a share as you describe.

Crackbone
May 23, 2003

Vlaada is my co-pilot.

TheGopher posted:

Not accessible is a permissions error. Check the logs for more info, and try using SWAT if you're having a lot of trouble. I can post my smb.conf once I'm at work, as that machine is running Fedora 13 and hosts a share as you describe.

What logs?

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

Crackbone posted:

What logs?

look in /var/log/samba/

Modern Pragmatist
Aug 20, 2008

Crackbone posted:

Samba stuff

Remember that in addition to the permissions specified in smb.conf file, you need to make sure that you have the actual folder permissions set properly.

Here is my smb.conf (Version 3.5.8-74.fc14)
code:
[global]
	workgroup = RADIOLOGY 
	server string = Samba Server Version %v

	log file = /var/log/samba/log.%m
	max log size = 50


#============================ Share Definitions ==============================

[homes]
	comment = Home Directories
	browseable = no
	writable = yes
;	valid users = %S
;	valid users = MYDOMAIN\%S

[printers]
	comment = All Printers
	path = /var/spool/samba
	browseable = no
	guest ok = no
	writable = no
	printable = yes

[share]
        path=/home/shared/smbshare
        available = yes
        valid users = admin mri
        read only = no
        browsable = yes
        public = yes
        writable = yes
        create mask = 664
        directory mask = 775

Crackbone
May 23, 2003

Vlaada is my co-pilot.

Modern Pragmatist posted:

Remember that in addition to the permissions specified in smb.conf file, you need to make sure that you have the actual folder permissions set properly.

Here is my smb.conf (Version 3.5.8-74.fc14)
code:
[global]
	workgroup = RADIOLOGY 
	server string = Samba Server Version %v

	log file = /var/log/samba/log.%m
	max log size = 50


#============================ Share Definitions ==============================

[homes]
	comment = Home Directories
	browseable = no
	writable = yes
;	valid users = %S
;	valid users = MYDOMAIN\%S

[printers]
	comment = All Printers
	path = /var/spool/samba
	browseable = no
	guest ok = no
	writable = no
	printable = yes

[share]
        path=/home/shared/smbshare
        available = yes
        valid users = admin mri
        read only = no
        browsable = yes
        public = yes
        writable = yes
        create mask = 664
        directory mask = 775

If I'm reading this correctly though, that share requires a user to provide an user/pass to connect? I'm wanting an r/w share without the user being forced to provide credentials. I guess the problem is I don't know what the proper way to implement that is. I've diddled around with several different things like guest only, map guest = bad user/pass, force user, etc.

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

This is one I have that is writable by anyone

[archive]
comment = Archive Data
path = /exports/archive
public = yes
writable = yes
write list = @staff
hide unreadable = yes

TheGopher
Sep 7, 2009
The following works on my Fedora 13 machines with samba-3.5.8-74.fc13.i686.

code:
[global]
        server string = Samba
        interfaces = eth0, $local_ip/255.255.255.0, 127.0.0.1/255.0.0.0
        map to guest = Bad User
        guest account = ftp
        lanman auth = Yes
        client lanman auth = Yes

[samba]
        comment = Samba share
        path = /share
        read only = no
        guest ok = yes
This lets me anonymously read and write to /share. Permissions for /share are:

# ls -ld share
drwxrwxrwx. 24 $user root 4096 Apr 19 17:05 share


I probably could do better with those permissions, but I'm not too concerned as this is not a public-facing terminal and I was having difficulties getting it to work.

Crackbone
May 23, 2003

Vlaada is my co-pilot.

TheGopher posted:

The following works on my Fedora 13 machines with samba-3.5.8-74.fc13.i686.

code:
[global]
        server string = Samba
        interfaces = eth0, $local_ip/255.255.255.0, 127.0.0.1/255.0.0.0
        map to guest = Bad User
        guest account = ftp
        lanman auth = Yes
        client lanman auth = Yes

[samba]
        comment = Samba share
        path = /share
        read only = no
        guest ok = yes
This lets me anonymously read and write to /share. Permissions for /share are:

# ls -ld share
drwxrwxrwx. 24 $user root 4096 Apr 19 17:05 share


I probably could do better with those permissions, but I'm not too concerned as this is not a public-facing terminal and I was having difficulties getting it to work.

Thanks for the config, I'll give it a shot. Did you have any issues with SELinux settings? Coworking is swearing up and down that's part of the problem.

Adbot
ADBOT LOVES YOU

bag of a bee
Jun 17, 2007

Forgive my ignorance but is there a simple shell command that would delete all files with the extension .jpg and .ini in a directory and all its sub directories?

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