?? How To Auto Mount Logical Volume Before Transmission-daemon Starts At Start Up

I have been using an old computer to download my torrents and this has been my usual routine:

1. Press the power button.
2. Connect to the computer through Putty
3. Log in
4. Gain su privileges

Startup Commands:
Code:
/etc/init.d/transmission-daemon stop
apt-get update
mount -t ext4 /dev/vgTransmission/lvTransmission /mnt/transmissionVault
/etc/init.d/transmission-daemon start

Shutdown Commands:
Code:
/etc/init.d/transmission-daemon stop
umount /dev/vgTransmission/lvTransmission
shutdown -h now

I was wondering if there is a way to configure a computer to automatically mount a logical volume “before” the transmission-daemon starts at boot up (note my first Startup Command).

I think the instructions here are related to what I want to do, but I want to get some advice before I attempt to do anything dangerous:
http://tille.garrels.be/training/tld...#sect_04_02_04


My perfect scenario would be:

Startup Routine:
1. Send WakeOnLan magic packet to computer to turn it on.
2. Computer boots up, mounts the transmissionVault logical volume
3. Wait 10 seconds to ensure that the logical volume has finished mounting
4. Start transmission-daemon

Shutdown Routine:
Send WakeOnLan magic packet to turn off computer, i.e.: Execute “shutdown -h now”
The shutdown command should include:
1. Stop transmission-daemon
2. Wait 10 seconds to ensure that transmission-daemon has finished shutting down
3. Umount transmissionVault logical volume




Recently the Ethernet port of my transmission box has stopped working, so I went ahead and swapped the motherboard with another old motherboard, added a few hard drives, installed a fresh copy of Debian, and re-created the LVM logical volume for transmissionVault. I pretty much have a fairly stock system running at the moment.

Running a headless 3.2.0-4-amd64


Similar Content



Assign Group Permission To Newly Created Files

Directory /media/data/torrents/ has permissions 775, user yzt, group transmission

yzt and debian-transmission are members of the group transmission.

transmission-daemon is run by debian-transmission, and the new files it downloads have permissions 644, owner debian-transmission, group transmission. This is a problem, because I can't later move the files as my user, yzt, and need to be switching to root to change the permissions/ownership to be able to do so.

Using sticky bit I could copy it to anywhere else, but I'm interested on actually moving the file, not just copying it. I could run transmission-daemon as yzt and problem solved, but I rather have that internet facing service running by a limited user, just in case some vulnerability is found on Transmission.

So my question is, how can I set that every new file created under /media/data/torrents/ has permissions 775 like its parent directory?

Vgchange -an Command Fail To Work To Inactive VG || Umount Logical Volume Succesfull

Hi All,

umounted all logical volume of tomcatvg successfully.But when tried to deactive Volume group using vgchange command show logical volume are in active state .Need help how to force de-active Volume group .


Actioned perfomed
================
vgchange -an tomcatvg


[root@porsche ~]# vgs
VG #PV #LV #SN Attr VSize VFree
tomcatvg 1 10 0 wz--n- 95.38g 8.88g


[root@porsche ~]# cat /etc/fstab | grep -i fs_opt_tomcat
/dev/tomcatvg/fs_opt_tomcat /opt/tomcat ext4 defaults 1 2
[root@porsche ~]#

fuser -km /opt/tomcat
umount /opt/tomcat

Still I could find logical volume in active state

[root@porsche ~]# lvs | grep -i appvg
fs_opt_tomcat tomcatvg -wi-ao---- 5.00g

Regards
Arun

Unable To Enter Command Because Of Daemon Job On Startup

Good day

I have a application that startup as a daemon when the system boot-up. My problem is that it display that this application is running and nothing else is happening then. I am unable to enter any commands. I have tried all kind off key presses but cannot get to the prompt.

First off all why will this happen and then is there a way to get to the prompt without accessing the system with the network?

Thank you.

Help In Ns2

hello all,

I have questions

How to specify Transmission Time and Transmission Rate in ns2 ????

Are Logical Volumes In LVM Separte From Each Other, Like A Partition?

Even though they are on the same Volume Group?

I'm still having a hard time understanding this.

Let's say for example, that I have the following:

Code:
# df -ha

VolGroup00/LogVol2     /tmp

VolGroup00/LogVol5     /opt

VolGroup00/LogVol3     /var

I have three different Logical Volumes where /tmp, /opt and /var live. Are these separate like a partition that one would place on a physical disk?

Keep in mind that they all are on the same Volume Group as well?

Managing Startup And Shutdown Dependencies

I have a dedicated PC providing storage of my music collection and streaming albums via Logitechmediaserver (LMS). OS is Arch running headless. For performance purposes I'd like LMS to access its SQLite database files from a RAM disk which must be dynamically created on startup of the PC with DB copied across from HDD prior to startup of LMS. On shutting down the PC the only changed files should be copied from the ramdisk back to the HDD. The intent would be to use rsync for the copying.

/etc/fstab is configured to create the ramdisk on startup:
Code:
tmpfs      /mnt/ramdisk tmpfs     defaults,size=4096M 0    0

and LMS has already been configured to look for its DB files in /mnt/ramdisk.

LMS' unit file is /usr/lib/systemd/system/logitechmediaserver.service. Its contents is as follows:
Code:
[Unit]
Description=Logitech Media Server Daemon
After=network.target

[Service]
User=logitechms
Group=logitechms
PIDFile=/var/run/lms.pid
WorkingDirectory=/opt/logitechmediaserver
ExecStart=/opt/logitechmediaserver/slimserver.pl \
	--prefsdir /opt/logitechmediaserver/prefs \
	--cachedir /opt/logitechmediaserver/cache \
	--logdir /opt/logitechmediaserver/Logs

[Install]
WantedBy=multi-user.target

On the startup leg, the data needs to be copied prior to launch of LMS, on the shutdown leg, LMS needs to be stopped and trigger the rsync diff copy. How would I best go about calling a script on startup and shutdown of the PC to ensure that the contents is synced to and from ramdisk on startup and shutdown?

Ok, here is what I've done so far, perhaps someone can critique it for me:

I created a file /etc/systemd/service/sync-lms-to-ramdisk.service containing the following:

Code:
[Unit]
Description=Copy LMS data data directory to ramdisk
After=network.target
Before=logitechmediaserver.service

[Service]
ExecStart=/usr/bin/sync-lms-to-ramdisk.sh

[Install]
WantedBy=multi-user.target

I then created /usr/bin/sync-lms-to-ramdisk.sh containing the following:
Code:
#! /bin/sh 
# /usr/bin/sync-lms-to-ramdisk.sh
#

rsync -av /mnt/md127/zSqueezeCache/ /mnt/ramdisk/
exit 0

I made it executable as follows:
Code:
chmod 755 /usr/bin/sync-lms-to-ramdisk.sh

I then enabled the Unit as follows:
Code:
systemctl enable sync-lms-to-ramdisk.service

If I'm not mistaken that should ensure that the ramdisk is populated before LMS fires up

Well, rebooted the server and the ramdisk is populated, but all is not well - LMS is inaccessible.

# systemctl status logitechmediaserver yields:

Code:
# systemctl status logitechmediaserver
● logitechmediaserver.service - Logitech Media Server Daemon
   Loaded: loaded (/usr/lib/systemd/system/logitechmediaserver.service; enabled)
   Active: inactive (dead) since Sun 2015-03-08 17:25:46 SAST; 18min ago
  Process: 411 ExecStart=/opt/logitechmediaserver/slimserver.pl --prefsdir /opt/logitechmediaserver/prefs --cachedir /opt/logitechmediaserver/cache --logdir /opt/logitechmediaserver/Logs (code=exited, status=0/SUCCESS)
 Main PID: 411 (code=exited, status=0/SUCCESS)



cat /usr/lib/systemd/system/logitechmediaserver.service yields:
Code:
[Unit]
Description=Logitech Media Server Daemon
After=network.target

[Service]
User=logitechms
Group=logitechms
PIDFile=/var/run/lms.pid
WorkingDirectory=/opt/logitechmediaserver
ExecStart=/opt/logitechmediaserver/slimserver.pl \
	--prefsdir /opt/logitechmediaserver/prefs \
	--cachedir /opt/logitechmediaserver/cache \
	--logdir /opt/logitechmediaserver/Logs

[Install]
WantedBy=multi-user.target

Quick question - is /etc/fstab processed before all of the abovementioned?

Ok, I've got the problem narrowed down to folder permissions. for some reason on creation of the ramdisk its owner is samba whereas it should be owned by logitechems. I amended /usr/bin/sync-lms-to-ramdisk.sh to change ownership of /mnt/ramdisk to logitechms:
Code:
 
#! /bin/sh 
# /usr/bin/sync-lms-to-ramdisk.sh
#

chown logitechms:logitechms /mnt/ramdisk/
rsync -av /mnt/md127/zSqueezeCache/ /mnt/ramdisk/
exit 0

However, on reboot ownership is again assigned to samba

Any ideas?

How Can I Set A Ftp Daemon On Embedded Linux ?

Hi,

I am currently working on a Embedded system (linux 2.6.24) and need to set a ftp daemon on it.
I have the busybox v1.4.2 on it but it don't have ftpd on it.
After searching on internet i find tons of way to install a ftp daemon on normal linux computer but no explanation on how to do it on an Embedded devive.
I am not the one who installed the distro and busybox, i have no knowledge on how to make this. I have no sudo/apt-get/make command on my system.

Inet.conf Never Start The Ftp Daemon

Hi,

i am trying the run a ftp daemon on my board (sbc6000x) but it seems that the ftpd service is never started by inetd.conf.

My inetd.conf is :

Code:
#<service_name>	<sock_type>	<proto>	<flags> <user> 	<server_path> 	<args> 

ftp			stream		tcp		nowait	root	/usr/bin/ftpd ftpd -w
telnet			stream		tcp		nowait	root    /usr/sbin/telnetd

Telnet don't run too but this is because i am missing some folders and i can launch it manually after creating the folders without issue, but maybe the fact that it can't run telnet because of the missing folders make it stop trying the ftp daemon ?

I check with the command "ps", the processus is not running hidden anywhere.

Back Up Plan For San Migration. Lvmconvert--2 Leg Scenario.

Hello,

So I am going to move lvm from one san to anohter.
Its on CentOS 5.

so "lvm1" from "sanA" to "sanB"
I do

Code:
>lvconvert -m1 --corelog VG/lvm1   /dev/disk_on_sanB
check:
>lvmdisplay  -m
...
..
Logical volume lvm1_mimage_0
......
Logical volume lvm1_mimage_1

then I break the mirror, taking off lvm1 from old sanA
>lvconvert -m0 VG/lvm1  /dev/disk_on_sanA

At this point if some thing goes wrong, is there a way to bring back original lvm1(from sanA) back to the server ?

Thanks

Inetd Listening But No Connection (ftp/Telnet)

Hello,

I try to use a ftp daemon and a Telnet daemon with inetd and the BusyBox v1.19.0 on a linux 2.6.24.

When running inetd and then checking what is listening with "netstat -an |grep LISTEN" i have :
Code:
netstat: /proc/net/tcp6: No such file or directory
netstat: /proc/net/udp6: No such file or directory
netstat: /proc/net/raw6: No such file or directory
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN

tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN

tcp        0      0 0.0.0.0:23              0.0.0.0:*               LISTEN

ftp port 21 and Telnet port 23 seems to be listening.

My inetd.conf file is :

Code:
#<service_name>    <sock_type>    <proto>    <flags> <user>     <server_path>     <args> 

21 stream tcp nowait root ftpd ftpd /etc
telnet            stream        tcp        nowait    root    /usr/sbin/telnetd

I have no rule in my hosts.deny so nothing should be stopped and i have no iptables firewall in place too.

When typing "ftp://ipofthetarget" in a web browser i have a error :

Code:
504 Gateway Timeout
Gateway timeout expired while waiting for server response.

And when trying to Telnet from another computer or "Telnet localhost" from the board i have :
Code:
# telnet 10.2.29.201
Trying 10.2.29.201...
connected to 10.2.29.201.
Escape character is '^]'

Connection closed by foreign host.

This would mean that the connection for Telnet exist but why is it closing ?

Thank you for your future answers !

UPDATE 1 :
If i try to run telnetd like this :
/usb/sbin/telnet -l /bin/sh
i can connect anonymously from another computer, not perfect because i would like a user/password but still of use.
The problem with the ftp daemon still exist.

UPDATE 2 :
Trying from Windows cmd or linux terminal : ftp ipofthetarget seems to work
Not perfect because i would like a user/password too but still of use.

I am still open for suggestion for the user/password thing. I am not deleting the thread in case someone interested about this exist.