error10 / kexec-reboot

Reboot in seconds, not minutes
GNU General Public License v3.0
250 stars 29 forks source link

(apparently) Unable to find ruby #1

Closed maxxer closed 9 years ago

maxxer commented 9 years ago

Running ./kexec-reboot on my Ubuntu 14.10 amd64 (italian locale) results in:

$ ./kexec-reboot 
: File o directory non esistente

While if I run ruby ./kexec-reboot it works and shows the help.

$ ruby --version
ruby 2.1.2p95 (2014-05-08) [x86_64-linux-gnu]
$ kexec --version
kexec-tools 2.0.7 released 02 October 2014
error10 commented 9 years ago

OK, on a freshly installed utopic in Italian I get:

root@ubuntu:~# wget https://github.com/error10/kexec-reboot/raw/master/kexec-reboot
--2015-04-01 22:44:34--  https://github.com/error10/kexec-reboot/raw/master/kexec-reboot
Risoluzione di github.com (github.com)... 192.30.252.131
Connessione a github.com (github.com)|192.30.252.131|:443... connesso.
Richiesta HTTP inviata, in attesa di risposta... 302 Found
Posizione: https://raw.githubusercontent.com/error10/kexec-reboot/master/kexec-reboot [segue]
--2015-04-01 22:44:35--  https://raw.githubusercontent.com/error10/kexec-reboot/master/kexec-reboot
Risoluzione di raw.githubusercontent.com (raw.githubusercontent.com)... 199.27.75.133
Connessione a raw.githubusercontent.com (raw.githubusercontent.com)|199.27.75.133|:443... connesso.
Richiesta HTTP inviata, in attesa di risposta... 200 OK
Lunghezza: 7375 (7,2K) [text/plain]
Salvataggio in: "kexec-reboot"

100%[======================================>] 7.375       --.-K/s   in 0,001s  

2015-04-01 22:44:35 (5,57 MB/s) - "kexec-reboot" salvato [7375/7375]

root@ubuntu:~# chmod +x kexec-reboot 
root@ubuntu:~# ./kexec-reboot -i
/usr/bin/env: ruby: File o directory non esistente

That's normal since I didn't install ruby and kexec-tools yet. So I apt-get install ruby kexec-tools, and then I get:

root@ubuntu:~# ./kexec-reboot -i
Can't find the mount point for device /dev/vda1
Can't find the mount point for device /dev/vda1
Can't find the mount point for device /dev/vda1

Select a kernel to stage:

1: Ubuntu
2: Ubuntu, con Linux 3.16.0-23-generic
3: Ubuntu, with Linux 3.16.0-23-generic (recovery mode)

Your selection: 

So I guess I can't reproduce this yet. Has your copy been altered in any way? Specifically, the very first line, which should read:

#!/usr/bin/env ruby

Or do you have any other startup scripts or something that would interfere with your PATH?

maxxer commented 9 years ago

Found it out: CRLF line terminators! After running dos2unix kexec-reboot I can normally execute kexec-reboot. Dunno if it's an issue with my specific installation or with my Git config (I cloned the repo).

error10 commented 9 years ago

Hmm. I haven't got any CRs in my local repo. It might be you have a git line ending option set to something strange.