Bosse_B
Posts: 981
Joined: Thu Jan 30, 2014 9:53 am

Startup errors on Pi2 using Pi1 image

Sun Feb 22, 2015 10:33 pm

I have set up a Pi2B using the SDcard image from a Pi1B following advice in this thread to first do this:

Code: Select all

sudo apt-get update
sudo apt-get dist-upgrade -y
Then use Win32Diskimager to make an image of the upgraded Pi1B Raspbian followed by writing the same to a Micro-SD card to be used in the Pi2B.
Today I finally got hold of the TV so I can watch what is going on during startup, so I powered it up after first shutting down the original Pi1B.
After the start I interrogated my router to see what IP address was given to the new Pi2, so I could connect PuTTY using thta new address. Logged on and changed the hostname (since it was the same as the Pi1B).

Problem:
I have two services on the original P1B, which show up on the start screen as having errors.
These are:
- PPTP VPN server
- OpenVPN server
both of which I want to run on this Pi2 rather than on the original because of the higher processing power.
Hand copied from the TV screen:

Code: Select all

[FAIL] Starting virtual private network daemon: server failed!
Starting PPTP daemon pptpd.
[FAIL] startpar: service(s) returned failure: openvpn ... failed!
Question:
How can I find out what is the cause of the start errors?
Is there a log somewhere I can view? And how?
Bo Berglund
Sweden

User avatar
expandables
Posts: 654
Joined: Fri Jun 27, 2014 7:34 pm
Location: Neverland with Michael Jackson

Re: Startup errors on Pi2 using Pi1 image

Sun Feb 22, 2015 10:55 pm

Sometimes the server.conf is missing in the /etc/openvpn directory. Or there is an error in that file.
You might not start it as root or the init scrips (/etc/init.d/openvpn) has a non-existing user.

You can enable debug logging in the server.conf and then try to start it again.
Can you also try

Code: Select all

sudo /etc/init.d/openvpn start
:mrgreen:
By thinking like an engineer you can create a raspberry pi.
Michael Jackson enthusiast.
I got the PI model B, B+ and PI 2 model B.
When will I get the A? I don't know.

Bosse_B
Posts: 981
Joined: Thu Jan 30, 2014 9:53 am

Re: Startup errors on Pi2 using Pi1 image

Sun Feb 22, 2015 11:24 pm

Where do I find server.conf?

EDIT:
I got rid of the PPTP start error by editing the /etc/pptpd.conf file and changing localip to the new IP address.
Can't find a corresponding entry for openvpn though...
Bo Berglund
Sweden

User avatar
expandables
Posts: 654
Joined: Fri Jun 27, 2014 7:34 pm
Location: Neverland with Michael Jackson

Re: Startup errors on Pi2 using Pi1 image

Sun Feb 22, 2015 11:35 pm

You might need to revise the tutorial you did to install openvpn. There you should get the solution to solve your problem. :mrgreen:
By thinking like an engineer you can create a raspberry pi.
Michael Jackson enthusiast.
I got the PI model B, B+ and PI 2 model B.
When will I get the A? I don't know.

Bosse_B
Posts: 981
Joined: Thu Jan 30, 2014 9:53 am

Re: Startup errors on Pi2 using Pi1 image

Sun Feb 22, 2015 11:46 pm

Boy, I am daft! :oops:
I thought that server.conf was a raspbian thing but in reality it is the openvpn configuration file:
/etc/openvpn/server.conf
And sure enough, the old IP was present on line #2...
Changed it and no more errors on start! :D

However I have a little different problem concerning the routing system:

Code: Select all

pi@raspbian-pi2 ~ $ sudo iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
SNAT       all  --  10.8.0.0/24          anywhere             to:192.168.0.146
SNAT       all  --  10.8.0.0/24          anywhere             to:192.168.0.146
The two lines containing something are wrong...
The iptables have been set up once on my Pi1B using its IP address and this is of course also wrong.
But I don't know about a similar conf file to edit to get this right...
Any suggestions?
So if there are erroneous entries in iptables, how can these be corrected?
If left like they are I think that the routing will not work on this OpenVPN server.
Bo Berglund
Sweden

User avatar
expandables
Posts: 654
Joined: Fri Jun 27, 2014 7:34 pm
Location: Neverland with Michael Jackson

Re: Startup errors on Pi2 using Pi1 image

Mon Feb 23, 2015 12:25 am

Here is the full openvpn tutorial it shows you how to setup iptables http://raspberrypi-hacks.com/29/turn-yo ... pn-server/ :mrgreen:
By thinking like an engineer you can create a raspberry pi.
Michael Jackson enthusiast.
I got the PI model B, B+ and PI 2 model B.
When will I get the A? I don't know.

Return to “Raspberry Pi OS”