JP1 Remotes Forum Index JP1 Remotes


FAQFAQ SearchSearch 7 days of topics7 Days MemberlistMemberlist UsergroupsUsergroups RegisterRegister
ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in

Please test: improved Linux access to URC-6440+OARUSB04G
Goto page Previous  1, 2, 3, 4
 
Post new topic   Reply to topic    JP1 Remotes Forum Index -> JP1 - General Forum
View previous topic :: View next topic  
Author Message
mathdon
Expert


Joined: 22 Jul 2008
Posts: 4523
Location: Cambridge, UK

                    
PostPosted: Sun Jul 02, 2023 1:32 pm    Post subject: Reply with quote

Can you please suggest the changes you think I should make, as I don't know how to incorporate what you say into my instructions or shell script.
_________________
Graham
Back to top
View user's profile Send private message
davecs



Joined: 28 Mar 2005
Posts: 328
Location: UK

                    
PostPosted: Sun Jul 02, 2023 2:10 pm    Post subject: Reply with quote

Substitute the text that follows for the sentence that begins "To run it from the terminal".

You will need to run it from a root terminal. To get a root terminal, you must open a terminal, then, depending on the version of Linux you are using, enter one of the following lines:

sudo su

su

The first of these may take you straight to a root terminal, or it may prompt you for your own password. With the second, you will be prompted for the root password. Now set URC6440_OARUSB04G_LinuxSupport as the current directory and run the command "sh Linux6440fix.sh".
_________________
URC7560/URC7562, URC8910, URC7980, URC6440/OARUSB04G and URC3661
Back to top
View user's profile Send private message Visit poster's website
davecs



Joined: 28 Mar 2005
Posts: 328
Location: UK

                    
PostPosted: Mon Jul 03, 2023 4:11 am    Post subject: Reply with quote

Sorry Graham, there's an easier way.

Instead of running "sh Linux6440fix.sh", you run "sudo sh Linux6440fix.sh" or "su -c sh Linux6440fix.sh", depending on your distro. You will be asked for a password.
_________________
URC7560/URC7562, URC8910, URC7980, URC6440/OARUSB04G and URC3661
Back to top
View user's profile Send private message Visit poster's website
mathdon
Expert


Joined: 22 Jul 2008
Posts: 4523
Location: Cambridge, UK

                    
PostPosted: Mon Jul 03, 2023 5:33 am    Post subject: Reply with quote

davecs wrote:
Sorry Graham, there's an easier way.

Instead of running "sh Linux6440fix.sh", you run "sudo sh Linux6440fix.sh" or "su -c sh Linux6440fix.sh", depending on your distro. You will be asked for a password.

Thank goodness for that! I have tried your earlier suggestion and was about to give you my comments. Here they are anyway, so you will see why I say "thank goodness" Smile .

Quote:
Many thanks. I have changed the instructions and deleted the occurrences of "sudo" from the shell script. I have tested it by first deleting the root files that the script creates, then doing "sudo su" followed by running the script.

It worked, but I found a few things rather off-putting. One was that I was not sure what "sudo su" had done. It gave what I now know was a prompt, but it looked so different from the normal one and ending in # rather than $, that it was not obvious to me that it was a prompt. It was also not clear how to get back to me as user after running the script. I found that "su graham" did the trick, presumably su plus username, but I had to look that up.

It was also more difficult to change the current directory after doing "sudo su" as it needed the full path from root given whereas normally "~" refers to the user's home directory. I suppose I could use ".." to move backwards to a suitable starting point, but I found it better to change it to URC6440_OARUSB04G_LinuxSupport before doing "sudo su" as that does not change the current directory.

Because of these findings, I have slightly changed your suggested replacement text to

Code:
You will need to run it from a root terminal. To get a root terminal, open a terminal and set URC6440_OARUSB04G_LinuxSupport as the current directory.  Then, depending on the version of Linux you are using, enter one of the following lines:

sudo su

su

The first of these may take you straight to a root terminal, or it may prompt you for your own password. With the second, you will be prompted for the root password. In either case the current directory should still be URC6440_OARUSB04G_LinuxSupport.  Finally run the command "sh Linux6440fix.sh" to do the necessary copying.  You should then be able to change back from a root terminal to your normal user terminal with the command "su <username>" where <username> should be replaced by your username.

I have tested the new way and it works. I will amend my amended instructions to use this.
_________________
Graham
Back to top
View user's profile Send private message
davecs



Joined: 28 Mar 2005
Posts: 328
Location: UK

                    
PostPosted: Mon Jul 03, 2023 8:10 am    Post subject: Reply with quote

Yes. Most Linux systems (Ubuntu, Mint) use sudo to run a command that requires administration level access. You may or may not be asked for your own password. In some distros (PCLinuxOS), such use of sudo is not allowed and you must have the root (i.e., administrator) password. In such cases, su -c does the same job as sudo but requires the root password.

The prompt with the # instead of $ means you are in a root terminal and can run admin commands without preceding them with sudo or su -c. You get back to the $ prompt by typing the command exit.
_________________
URC7560/URC7562, URC8910, URC7980, URC6440/OARUSB04G and URC3661
Back to top
View user's profile Send private message Visit poster's website
davecs



Joined: 28 Mar 2005
Posts: 328
Location: UK

                    
PostPosted: Mon Jul 03, 2023 8:17 am    Post subject: Reply with quote

mathdon wrote:
davecs wrote:
Sorry Graham, there's an easier way.

Instead of running "sh Linux6440fix.sh", you run "sudo sh Linux6440fix.sh" or "su -c sh Linux6440fix.sh", depending on your distro. You will be asked for a password.

Thank goodness for that! I have tried your earlier suggestion and was about to give you my comments. Here they are anyway, so you will see why I say "thank goodness" Smile .

Quote:
Many thanks. I have changed the instructions and deleted the occurrences of "sudo" from the shell script. I have tested it by first deleting the root files that the script creates, then doing "sudo su" followed by running the script.

It worked, but I found a few things rather off-putting. One was that I was not sure what "sudo su" had done. It gave what I now know was a prompt, but it looked so different from the normal one and ending in # rather than $, that it was not obvious to me that it was a prompt. It was also not clear how to get back to me as user after running the script. I found that "su graham" did the trick, presumably su plus username, but I had to look that up.

It was also more difficult to change the current directory after doing "sudo su" as it needed the full path from root given whereas normally "~" refers to the user's home directory. I suppose I could use ".." to move backwards to a suitable starting point, but I found it better to change it to URC6440_OARUSB04G_LinuxSupport before doing "sudo su" as that does not change the current directory.

Because of these findings, I have slightly changed your suggested replacement text to

Code:
You will need to run it from a root terminal. To get a root terminal, open a terminal and set URC6440_OARUSB04G_LinuxSupport as the current directory.  Then, depending on the version of Linux you are using, enter one of the following lines:

sudo su

su

The first of these may take you straight to a root terminal, or it may prompt you for your own password. With the second, you will be prompted for the root password. In either case the current directory should still be URC6440_OARUSB04G_LinuxSupport.  Finally run the command "sh Linux6440fix.sh" to do the necessary copying.  You should then be able to change back from a root terminal to your normal user terminal with the command "su <username>" where <username> should be replaced by your username.

I have tested the new way and it works. I will amend my amended instructions to use this.


From "To run it from the terminal" to the end of the paragraph should read:

To run it from Terminal, set URC6440_OARUSB04G_LinuxSupport as the current directory. If your Linux distro supports "sudo", run the command sudo sh Linux6440fix.sh, you may be prompted for your password. Otherwise run the command su -c sh\ Linux6440fix.sh and you will be prompted for the root password. The three files will be installed on your computer, but will not become active until you reboot.

You also need to remove all instances of "sudo" in the script. By putting sudo or su -c on the line where you run the script, it's not needed again inside it, and will even trip up distros that don't use sudo.

P.S. I always find an easier way, or a better way of explaining it, but never until the second attempt, at least!

P.P.S A word of explanation. If you use su -c it treats the next word as a command and the following one a username (root if blank). So you have to escape the space in it, by putting a \ in front of it. Alternately you can put quotes around it. I thought it's easier to put in the \ because it's easier to misinterpret what the quotes are doing there. Any both ways work. su -c 'sh Linux6440fix.sh' or su -c sh\ Linux6440fix.sh
_________________
URC7560/URC7562, URC8910, URC7980, URC6440/OARUSB04G and URC3661
Back to top
View user's profile Send private message Visit poster's website
davecs



Joined: 28 Mar 2005
Posts: 328
Location: UK

                    
PostPosted: Mon Jul 03, 2023 10:31 am    Post subject: Reply with quote

MANUAL METHOD

I've now put this method in the Wiki.

I've changed the mount point to /mnt/REMOTE as it's a convention in Linux to mount things defined in /etc/fstab to /mnt/something. I've got a spare partition containing a distro where RMIR was not set up, so I was able to test that the mount by this method went correctly.
_________________
URC7560/URC7562, URC8910, URC7980, URC6440/OARUSB04G and URC3661
Back to top
View user's profile Send private message Visit poster's website
mathdon
Expert


Joined: 22 Jul 2008
Posts: 4523
Location: Cambridge, UK

                    
PostPosted: Mon Jul 03, 2023 1:37 pm    Post subject: Reply with quote

davecs wrote:
You also need to remove all instances of "sudo" in the script.

Yes, I had already done that in testing your previous method. I have made your latest change to the instructions and done final testing, so I have taken it that we are agreed all is well and have released RMIR v3.0.1. Many thanks for all your help with this.
_________________
Graham
Back to top
View user's profile Send private message
davecs



Joined: 28 Mar 2005
Posts: 328
Location: UK

                    
PostPosted: Mon Jul 03, 2023 2:19 pm    Post subject: Reply with quote

mathdon wrote:

Yes, I had already done that in testing your previous method. I have made your latest change to the instructions and done final testing, so I have taken it that we are agreed all is well and have released RMIR v3.0.1. Many thanks for all your help with this.


We did each other a favour. We both learnt a bit about strange udev behaviours under systemd, especially me, as I've been avoiding operating systems that use it. You learned that not all systems use sudo to carry out admin tasks, but instead require proper root access. I also realised that su -c is a viable alternative to sudo if it's just one command (as you have to put the root password in every time) I used to just do su > password > command(s) > exit without really thinking, but the need to simplify the instructions for a reader made me think about it.

So I reckon we've both gained a lot of knowledge!
_________________
URC7560/URC7562, URC8910, URC7980, URC6440/OARUSB04G and URC3661
Back to top
View user's profile Send private message Visit poster's website
mathdon
Expert


Joined: 22 Jul 2008
Posts: 4523
Location: Cambridge, UK

                    
PostPosted: Wed Jul 05, 2023 12:51 pm    Post subject: Reply with quote

davecs wrote:
So I reckon we've both gained a lot of knowledge!

I agree absolutely! I also believe you were right to include the Manual method in the Wiki as a fallback, in view of the variants in systemd that we have already seen. If it is changed still further in a way that prevents the Automatic method from working, and we can't resolve it, then I think that is the time to add something about the Manual method into RMIR. For the time being, at least, I prefer to leave that out.

In view of ibschenkel's post in my announcement thread, there will soon be a v3.0.2, so if you have any further suggestions, there is still time to make them.
_________________
Graham
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic       JP1 Remotes Forum Index -> JP1 - General Forum All times are GMT - 5 Hours
Goto page Previous  1, 2, 3, 4
Page 4 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

Powered by phpBB © 2001, 2005 phpBB Group
Top 7 Advantages of Playing Online Slots The Evolution of Remote Control